carson 2.13.1 → 2.13.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7fde15079ed380bb8c6e4d476fb8157dd7980ea6a250e06706188a645c1d160
4
- data.tar.gz: 85a76cdb10a52573ba463a884079178e2b69befe21b8b377bb425f620057bd65
3
+ metadata.gz: 8d19271a17424021f6b4ef1ceabe73275feb47c54965175fbd5fbd1a2b6f869b
4
+ data.tar.gz: 8011d1e680ba9331e99bd8254b0b07605f64ed1856baa6a62b53ec1f6eb98c7c
5
5
  SHA512:
6
- metadata.gz: 910cfd8d4ee3095b3ea559ba66bcd372d764043d02131f38d2d75071542aa04e1ea7cf5bdf10ab1aabd792f8ff21762ea31063720c23c719cc361d4313ea38fd
7
- data.tar.gz: 236417f25de6aba2640a3ec992c5f756851b931f961f213408f57533533403f20d011cf4169cb8384ed980d58100456e49ea9209ed08fc2bb87a2d9729fcd9e4
6
+ metadata.gz: 51be2370d394a2b83169b5ca543339a8949ec0a8cb969430e934d7a22977e3e085997c7d6f89006a7d128abb9a8f426c5f22327555a6d26f85c89c186eb25dc9
7
+ data.tar.gz: 9bc89f7a0f84f70d21c0a38ec5cca6b84d961ebab815bfb826f86a1316139915093f378fbbf8d52f9696d9445bacbe3d5677b3c78e14e6a9542b334128adfbb3
data/API.md CHANGED
@@ -99,6 +99,39 @@ Environment overrides:
99
99
  - `CARSON_WORKFLOW_STYLE`
100
100
  - `CARSON_RUBY_INDENTATION`
101
101
  - `CARSON_LINT_POLICY_SOURCE`
102
+ - `CARSON_GOVERN_REPOS`
103
+ - `CARSON_GOVERN_MERGE_AUTHORITY`
104
+ - `CARSON_GOVERN_MERGE_METHOD`
105
+ - `CARSON_GOVERN_AGENT_PROVIDER`
106
+ - `CARSON_GOVERN_CHECK_WAIT`
107
+
108
+ `govern` schema:
109
+
110
+ ```json
111
+ {
112
+ "govern": {
113
+ "repos": ["~/Dev/project-a", "~/Dev/project-b"],
114
+ "agent": {
115
+ "provider": "auto",
116
+ "codex": {},
117
+ "claude": {}
118
+ },
119
+ "check_wait": 30,
120
+ "merge": {
121
+ "authority": false,
122
+ "method": "squash"
123
+ }
124
+ }
125
+ }
126
+ ```
127
+
128
+ `govern` semantics:
129
+ - `repos`: list of local repo paths to govern (empty = current repo only).
130
+ - `agent.provider`: `"auto"`, `"codex"`, or `"claude"`.
131
+ - `agent.codex` / `agent.claude`: provider-specific options (reserved).
132
+ - `check_wait`: seconds to wait for CI checks before classifying (default: `30`).
133
+ - `merge.authority`: `false` (default) — Carson does not merge until explicitly enabled.
134
+ - `merge.method`: `"squash"` (default), `"merge"`, or `"rebase"`.
102
135
 
103
136
  `lint` schema:
104
137
 
data/README.md CHANGED
@@ -2,11 +2,15 @@
2
2
 
3
3
  # ⧓ Carson
4
4
 
5
+ *Carson at your service.*
6
+
5
7
  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.
6
8
 
7
- ## The Problem
9
+ ## The Problem to Solve
10
+
11
+ Managing a growing portfolio of repositories is rewarding work — but the operational overhead scales faster than the code itself. Lint configs drift between repos, PR templates go stale, reviewer feedback gets quietly buried, and what passes on a developer's laptop fails in CI. When coding agents start producing PRs across multiple projects, the coordination load multiplies: checking results, dispatching fixes, clicking merge, cleaning up branches.
8
12
 
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.
13
+ Carson exists so you can focus on what matters buildingwhile governance runs itself.
10
14
 
11
15
  ## How Carson Works
12
16
 
@@ -14,7 +18,7 @@ Carson is an autonomous governance runtime that lives on your workstation and in
14
18
 
15
19
  **Per-commit governance** — Carson 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. Lint execution is handled entirely by MegaLinter in CI and by the developer's own local tooling — Carson distributes the shared lint configuration but does not run linters itself.
16
20
 
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.
21
+ **Portfolio-level autonomy** — `carson govern` is a triage loop that scans your registered 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
22
 
19
23
  ```
20
24
  ┌──────────────────────────────────────────────┐
@@ -59,61 +63,7 @@ Carson is opinionated about governance. These are non-negotiable principles, not
59
63
  - **Self-diagnosing output** — every message names the cause and the fix. If you need to debug Carson's output, the output failed.
60
64
  - **Transparent governance** — Carson prepares everything for merge but never oversteps. It does not make decisions for you without telling you.
61
65
 
62
- Everything else workflow style, merge method, remote name, main branch is a configurable default chosen during `carson setup`. See `MANUAL.md` for the full list of defaults and why each was chosen.
63
-
64
- The data flow:
65
-
66
- 1. You maintain a **policy source** — a directory or git repository containing your lint config files (e.g. `.rubocop.yml`, `biome.json`, `ruff.toml`). `carson lint policy --source <repo>` copies these into each governed repo's `.github/linters/`, where MegaLinter auto-discovers them.
67
- 2. `carson onboard` installs git hooks, synchronises `.github/*` templates (including a MegaLinter CI workflow), and runs a first governance audit on a host repository.
68
- 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.
69
- 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**.
70
- 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.
71
-
72
- ## Commands at a Glance
73
-
74
- **Govern** — autonomous portfolio management:
75
-
76
- | Command | What it does |
77
- |---|---|
78
- | `carson govern` | Triage all open PRs: merge ready ones, dispatch agents for failures, escalate the rest. |
79
- | `carson govern --dry-run` | Show what Carson would do without taking action. |
80
- | `carson govern --loop SECONDS` | Run the govern cycle continuously, sleeping SECONDS between cycles. |
81
- | `carson housekeep` | Sync main + prune stale branches (also runs automatically after govern merges). |
82
-
83
- **Setup** — run once per machine or per repository:
84
-
85
- | Command | What it does |
86
- |---|---|
87
- | `carson lint policy --source <repo>` | Distribute lint configs from policy source into `.github/linters/`. |
88
- | `carson onboard` | One-command baseline: hooks + templates + first audit. |
89
- | `carson prepare` | Install or refresh Carson-managed global hooks. |
90
- | `carson refresh` | Re-apply hooks, templates, and audit after upgrading Carson. |
91
- | `carson refresh --all` | Refresh all governed repositories at once. |
92
- | `carson offboard` | Remove Carson from a repository. |
93
-
94
- **Daily** — regular development workflow:
95
-
96
- | Command | What it does |
97
- |---|---|
98
- | `carson audit` | Full governance check (also runs automatically on every commit). |
99
- | `carson sync` | Fast-forward local `main` from remote. |
100
- | `carson prune` | Remove stale local branches whose upstream is gone. |
101
- | `carson template check` | Detect drift between managed and host `.github/*` files. |
102
- | `carson template apply` | Repair drifted `.github/*` files. |
103
-
104
- **Review** — PR merge readiness:
105
-
106
- | Command | What it does |
107
- |---|---|
108
- | `carson review gate` | Block or approve merge based on unresolved review comments. |
109
- | `carson review sweep` | Scan recent PRs and update a tracking issue for late feedback. |
110
-
111
- **Info**:
112
-
113
- | Command | What it does |
114
- |---|---|
115
- | `carson version` | Print installed version. |
116
- | `carson inspect` | Verify Carson-managed hook installation and repository setup. |
66
+ Everything else bends to your preference. Which branch is main, how PRs are merged, which repositories to govern, which coding agent to dispatch, where your lint policy lives — Carson asks during setup and remembers. Sensible defaults are provided; you only change what matters to you. See `MANUAL.md` for the full list.
117
67
 
118
68
  ## Quickstart
119
69
 
@@ -121,7 +71,6 @@ Prerequisites: Ruby `>= 3.4`, `git`, and `gem` in your PATH.
121
71
  `gh` (GitHub CLI) is recommended for full review governance features.
122
72
 
123
73
  ```bash
124
- # Install
125
74
  gem install --user-install carson
126
75
  carson version
127
76
  ```
@@ -145,7 +94,7 @@ After `carson onboard`, your repository has:
145
94
 
146
95
  Commit the generated `.github/*` changes, and the repository is governed.
147
96
 
148
- **Daily workflow:**
97
+ **Run governance across your portfolio:**
149
98
 
150
99
  ```bash
151
100
  carson govern --dry-run # see what Carson would do across all repos
@@ -153,18 +102,9 @@ carson govern # triage PRs, merge ready ones, dispatch agents, hou
153
102
  carson govern --loop 300 # run continuously, cycling every 5 minutes
154
103
  ```
155
104
 
156
- Or the individual commands if you prefer manual control:
157
-
158
- ```bash
159
- carson audit # full governance check
160
- carson review gate # block or approve merge based on review status
161
- carson sync # fast-forward local main
162
- carson prune # clean up stale local branches
163
- ```
164
-
165
105
  ## Where to Read Next
166
106
 
167
- - **MANUAL.md** — installation, first-time setup, CI configuration, daily operations, troubleshooting.
107
+ - **MANUAL.md** — installation, first-time setup, CI configuration, daily operations, full command reference, troubleshooting.
168
108
  - **API.md** — formal interface contract: commands, exit codes, configuration schema.
169
109
  - **RELEASE.md** — version history and upgrade actions.
170
110
  - **docs/define.md** — product definition and scope.
data/RELEASE.md CHANGED
@@ -5,6 +5,14 @@ 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.13.2 — Docs Refresh
9
+
10
+ ### What changed
11
+
12
+ - Updated `docs/define.md`: added missing in-scope commands (`govern`, `housekeep`, `refresh --all`, `lint policy`); corrected out-of-scope merge authority statement.
13
+ - Updated `docs/plan.md`: corrected test counts, added `prompt.rb` and `runtime_refresh_all_test.rb` to file structure, added `--loop SECONDS` and `refresh --all` to CLI section, updated delivery status.
14
+ - Updated `API.md`: added `govern` config schema and environment overrides.
15
+
8
16
  ## 2.13.1 — Guided Governance Registration
9
17
 
10
18
  ### What changed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.13.1
1
+ 2.13.2
data/carson.gemspec CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |spec|
7
7
  spec.version = Carson::VERSION
8
8
  spec.authors = [ "Hailei Wang" ]
9
9
  spec.email = [ "wanghailei@users.noreply.github.com" ]
10
- spec.summary = "Autonomous governance runtime lint, review gates, PR triage, and merge across repositories."
11
- spec.description = "Carson lives outside the repositories it governs. On every commit it enforces centralised lint policy and scope checks. On PRs it gates merge on unresolved reviewer feedback, dispatches coding agents to fix CI failures, merges passing PRs, and housekeeps branches. Runs locally and in GitHub Actions."
10
+ spec.summary = "Autonomous repository governance — you write the code, Carson manages everything else."
11
+ spec.description = "Carson is a governance runtime that lives outside the repositories it governs — no Carson-owned artefacts in your repo. On every commit, managed hooks enforce centralised lint policy and review gates. At portfolio level, carson govern triages every open PR across your registered repositories: merge what's ready, dispatch coding agents to fix what's failing, escalate what needs human judgement. One command, all your projects, unmanned."
12
12
  spec.homepage = "https://github.com/wanghailei/carson"
13
13
  spec.license = "MIT"
14
14
  spec.required_ruby_version = ">= 3.4"
@@ -188,7 +188,7 @@ module Carson
188
188
  puts_line ""
189
189
  puts_line "Onboarding #{repo_name}..."
190
190
 
191
- unless global_config_exists?
191
+ if !global_config_exists? || !git_remote_exists?( remote_name: config.git_remote )
192
192
  if self.in.respond_to?( :tty? ) && self.in.tty?
193
193
  setup_status = setup!
194
194
  return setup_status unless setup_status == EXIT_OK
@@ -356,9 +356,9 @@ module Carson
356
356
  accepted = prompt_yes_no( default: true )
357
357
  if accepted
358
358
  append_govern_repo!( repo_path: expanded )
359
- puts_line "Registered."
359
+ puts_line "Registered. Run carson refresh --all to keep all repos in sync."
360
360
  else
361
- puts_line "Skipped. Re-run carson onboard to register later."
361
+ puts_line "Skipped. Run carson onboard here again to register later."
362
362
  end
363
363
  end
364
364
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carson
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.1
4
+ version: 2.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hailei Wang
@@ -9,10 +9,12 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
- description: Carson lives outside the repositories it governs. On every commit it
13
- enforces centralised lint policy and scope checks. On PRs it gates merge on unresolved
14
- reviewer feedback, dispatches coding agents to fix CI failures, merges passing PRs,
15
- and housekeeps branches. Runs locally and in GitHub Actions.
12
+ description: 'Carson is a governance runtime that lives outside the repositories it
13
+ governs no Carson-owned artefacts in your repo. On every commit, managed hooks
14
+ enforce centralised lint policy and review gates. At portfolio level, carson govern
15
+ triages every open PR across your registered repositories: merge what''s ready,
16
+ dispatch coding agents to fix what''s failing, escalate what needs human judgement.
17
+ One command, all your projects, unmanned.'
16
18
  email:
17
19
  - wanghailei@users.noreply.github.com
18
20
  executables:
@@ -93,6 +95,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
95
  requirements: []
94
96
  rubygems_version: 4.0.3
95
97
  specification_version: 4
96
- summary: Autonomous governance runtime lint, review gates, PR triage, and merge
97
- across repositories.
98
+ summary: Autonomous repository governance — you write the code, Carson manages everything
99
+ else.
98
100
  test_files: []