carson 2.13.1 → 2.13.3
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 -1
- data/API.md +34 -1
- data/MANUAL.md +5 -6
- data/README.md +29 -102
- data/RELEASE.md +27 -0
- data/VERSION +1 -1
- data/carson.gemspec +2 -2
- data/lib/carson/config.rb +1 -1
- data/lib/carson/runtime/local.rb +1 -1
- data/lib/carson/runtime/setup.rb +2 -2
- data/templates/.github/AGENTS.md +1 -1
- data/templates/.github/CLAUDE.md +1 -1
- data/templates/.github/carson.md +45 -0
- data/templates/.github/copilot-instructions.md +1 -1
- metadata +10 -8
- data/templates/.github/carson-instructions.md +0 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17b8bd4f2f9f3b9d1cc1d637accc607cfb3f7a49e98cc4a998cb8b797a82bc50
|
|
4
|
+
data.tar.gz: 3247d5bac41cbd0da539a45210521c66436b2ee3d2da8b6e28ee8f6a6c694955
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e018a857a0af89a3828355f0af131b4bf3fee40412d6c1e719c20493f9c6daf91f2da595d9b0b611f0df787a25e6d65997456668160615ca4b9c6419ffb89ee7
|
|
7
|
+
data.tar.gz: f7db01059c1dfb0b8be6be61c34859c157ac7283df40f010120f57bcdc1ad95b3bbdaf2a6596329be260be1dfcb818d2b177ded70e92d637294441fe70bc0f69
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Read `.github/
|
|
1
|
+
Read `.github/AGENTS.md` for repository governance rules enforced by Carson.
|
data/API.md
CHANGED
|
@@ -73,7 +73,7 @@ Blocked Carson artefacts in host repositories:
|
|
|
73
73
|
- `.tools/carson/*`
|
|
74
74
|
|
|
75
75
|
Allowed Carson-managed persistence in host repositories:
|
|
76
|
-
- `.github/carson
|
|
76
|
+
- `.github/carson.md` — governance baseline (source of truth)
|
|
77
77
|
- `.github/copilot-instructions.md` — agent discovery pointer for Copilot
|
|
78
78
|
- `.github/CLAUDE.md` — agent discovery pointer for Claude Code
|
|
79
79
|
- `.github/AGENTS.md` — agent discovery pointer for Codex
|
|
@@ -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/MANUAL.md
CHANGED
|
@@ -8,7 +8,7 @@ For the mental model and command overview, see `README.md`. For formal interface
|
|
|
8
8
|
Prerequisites: Ruby `>= 3.4`, `gem` and `git` in `PATH`. `gh` (GitHub CLI) recommended for full review governance.
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
gem install
|
|
11
|
+
gem install carson
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
If `carson` is not found after installation:
|
|
@@ -202,7 +202,7 @@ These define what Carson *is*. They are not configurable.
|
|
|
202
202
|
- **Outsider boundary** — Carson never places its own artefacts inside a governed repository.
|
|
203
203
|
- **Centralised lint** — one policy source distributed into each repo's `.github/linters/`, zero per-repo drift. MegaLinter enforces it in CI.
|
|
204
204
|
- **Active review** — undisposed reviewer findings block merge; feedback must be acknowledged.
|
|
205
|
-
- **Self-diagnosing output** — every
|
|
205
|
+
- **Self-diagnosing output** — every warning and error names what went wrong, why, and what to do next.
|
|
206
206
|
- **Transparent governance** — Carson prepares everything for merge but never makes decisions without telling you.
|
|
207
207
|
|
|
208
208
|
### Configurable defaults
|
|
@@ -299,10 +299,9 @@ Carson writes managed files that help interactive agents (Claude Code, Codex, Co
|
|
|
299
299
|
|
|
300
300
|
**How it works:**
|
|
301
301
|
|
|
302
|
-
- `.github/
|
|
303
|
-
- `.github/CLAUDE.md` — read by Claude Code at session start. Points to `
|
|
304
|
-
- `.github/
|
|
305
|
-
- `.github/copilot-instructions.md` — read by GitHub Copilot. Points to `carson-instructions.md`.
|
|
302
|
+
- `.github/AGENTS.md` — full governance baseline; read by Codex and other agents. Points to `carson.md`.
|
|
303
|
+
- `.github/CLAUDE.md` — read by Claude Code at session start. Points to `AGENTS.md`.
|
|
304
|
+
- `.github/copilot-instructions.md` — read by GitHub Copilot. Points to `AGENTS.md`.
|
|
306
305
|
|
|
307
306
|
Each agent reads its own expected filename and follows the reference to the shared baseline. One file to maintain, zero drift across agents.
|
|
308
307
|
|
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
|
-
|
|
13
|
+
Carson exists so you can focus on what matters — building — while governance runs itself.
|
|
10
14
|
|
|
11
15
|
## How Carson Works
|
|
12
16
|
|
|
@@ -14,27 +18,14 @@ 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
|
|
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
|
-
|
|
21
|
-
│
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
│ ~/.carson/cache/ Reports │
|
|
26
|
-
│ ~/.carson/govern/ Dispatch state │
|
|
27
|
-
│ │
|
|
28
|
-
│ carson govern ──► for each repo: │
|
|
29
|
-
│ 1. List open PRs (gh) │
|
|
30
|
-
│ 2. Classify: CI / review / audit status │
|
|
31
|
-
│ 3. Act: merge | dispatch agent | escalate │
|
|
32
|
-
│ 4. Housekeep: sync + prune │
|
|
33
|
-
│ │
|
|
34
|
-
│ Governed repos: repo-A/ repo-B/ repo-C/ │
|
|
35
|
-
│ .github/* templates (committed) │
|
|
36
|
-
│ core.hooksPath → ~/.carson/hooks │
|
|
37
|
-
└──────────────────────────────────────────────┘
|
|
24
|
+
~/.carson/ ← Carson lives here, never inside your repos
|
|
25
|
+
│
|
|
26
|
+
├─ hooks ──────────────► commit gates (every governed repo)
|
|
27
|
+
├─ lint configs ───────► .github/linters/ (MegaLinter auto-discovers)
|
|
28
|
+
└─ govern ─────────────► PR triage → merge | dispatch agent | escalate
|
|
38
29
|
```
|
|
39
30
|
|
|
40
31
|
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.
|
|
@@ -56,80 +47,17 @@ Carson is opinionated about governance. These are non-negotiable principles, not
|
|
|
56
47
|
- **Outsider boundary** — Carson lives outside your repo, never inside. No Carson-owned artefacts in your repository. Offboarding leaves no trace.
|
|
57
48
|
- **Centralised lint** — lint policy distributed from a central source into each repo's `.github/linters/`. One source of truth, zero drift. MegaLinter enforces it in CI.
|
|
58
49
|
- **Active review** — undisposed reviewer findings block merge. Feedback must be acknowledged, not buried.
|
|
59
|
-
- **Self-diagnosing output** — every
|
|
50
|
+
- **Self-diagnosing output** — every warning and error names what went wrong, why, and what to do next. If you have to read source code to understand a message, that message is a bug.
|
|
60
51
|
- **Transparent governance** — Carson prepares everything for merge but never oversteps. It does not make decisions for you without telling you.
|
|
61
52
|
|
|
62
|
-
Everything else
|
|
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. |
|
|
53
|
+
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
54
|
|
|
118
55
|
## Quickstart
|
|
119
56
|
|
|
120
|
-
Prerequisites: Ruby `>= 3.4`, `git`, and `gem` in your PATH.
|
|
121
|
-
`gh` (GitHub CLI) is recommended for full review governance features.
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
# Install
|
|
125
|
-
gem install --user-install carson
|
|
126
|
-
carson version
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**Prepare your lint policy.** A policy source is any directory (or git URL) containing your lint configuration files (`.rubocop.yml`, `biome.json`, `ruff.toml`, etc.). Carson copies these into the governed repo's `.github/linters/` where MegaLinter auto-discovers them:
|
|
57
|
+
Prerequisites: Ruby `>= 3.4`, `git`, and `gem` in your PATH. `gh` (GitHub CLI) is recommended for full review governance features.
|
|
130
58
|
|
|
131
59
|
```bash
|
|
132
|
-
|
|
60
|
+
gem install carson
|
|
133
61
|
```
|
|
134
62
|
|
|
135
63
|
**Onboard a repository:**
|
|
@@ -138,6 +66,8 @@ carson lint policy --source /path/to/your-policy-repo
|
|
|
138
66
|
carson onboard /path/to/your-repo
|
|
139
67
|
```
|
|
140
68
|
|
|
69
|
+
On first run, Carson walks you through setup — remote, main branch, workflow style, merge method — then installs hooks, syncs templates, and runs an initial audit.
|
|
70
|
+
|
|
141
71
|
After `carson onboard`, your repository has:
|
|
142
72
|
- Git hooks that run `carson audit` on every commit.
|
|
143
73
|
- Managed `.github/*` templates synchronised from Carson.
|
|
@@ -145,31 +75,28 @@ After `carson onboard`, your repository has:
|
|
|
145
75
|
|
|
146
76
|
Commit the generated `.github/*` changes, and the repository is governed.
|
|
147
77
|
|
|
148
|
-
**
|
|
78
|
+
**Set up lint policy** (optional). If you have a central directory or repository of lint configs, point Carson at it — configs are copied into `.github/linters/` where MegaLinter auto-discovers them:
|
|
149
79
|
|
|
150
80
|
```bash
|
|
151
|
-
|
|
152
|
-
carson
|
|
153
|
-
|
|
81
|
+
# local directory
|
|
82
|
+
carson lint policy --source /path/to/your-policy-dir
|
|
83
|
+
|
|
84
|
+
# remote repository
|
|
85
|
+
carson lint policy --source https://github.com/you/lint-policy.git
|
|
154
86
|
```
|
|
155
87
|
|
|
156
|
-
|
|
88
|
+
**Govern your portfolio.** Once repositories are onboarded, `carson govern` is your recurring command. Run it whenever you want Carson to triage open PRs, enforce review policy, dispatch coding agents, and housekeep across all governed repos:
|
|
157
89
|
|
|
158
90
|
```bash
|
|
159
|
-
carson
|
|
160
|
-
carson
|
|
161
|
-
carson
|
|
162
|
-
carson prune # clean up stale local branches
|
|
91
|
+
carson govern --dry-run # preview what Carson would do, change nothing
|
|
92
|
+
carson govern # triage PRs, merge ready ones, dispatch agents, housekeep
|
|
93
|
+
carson govern --loop 300 # run continuously, cycling every 5 minutes
|
|
163
94
|
```
|
|
164
95
|
|
|
165
96
|
## Where to Read Next
|
|
166
97
|
|
|
167
|
-
- **MANUAL.md** — installation, first-time setup, CI configuration, daily operations, troubleshooting.
|
|
98
|
+
- **MANUAL.md** — installation, first-time setup, CI configuration, daily operations, full command reference, troubleshooting.
|
|
168
99
|
- **API.md** — formal interface contract: commands, exit codes, configuration schema.
|
|
169
|
-
- **RELEASE.md** — version history and upgrade actions.
|
|
170
|
-
- **docs/define.md** — product definition and scope.
|
|
171
|
-
- **docs/design.md** — experience and brand design.
|
|
172
|
-
- **docs/develop.md** — contributor guide: architecture, development workflow.
|
|
173
100
|
|
|
174
101
|
## Support
|
|
175
102
|
|
data/RELEASE.md
CHANGED
|
@@ -5,6 +5,33 @@ 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.3 — Rename carson-instructions.md to carson.md
|
|
9
|
+
|
|
10
|
+
### What changed
|
|
11
|
+
|
|
12
|
+
- Renamed `.github/carson-instructions.md` → `.github/carson.md` in both the template set and the Carson repo itself. Shorter name, consistent with Carson's naming conventions.
|
|
13
|
+
- Enriched `carson.md` content: added Commands section (before committing, before merge, housekeeping), exit codes table, and clearer headings. Governance rules are unchanged.
|
|
14
|
+
- Updated agent pointer files: `CLAUDE.md` and `copilot-instructions.md` now point to `AGENTS.md`; `AGENTS.md` points to `carson.md`. One extra level of indirection, zero new files to maintain.
|
|
15
|
+
|
|
16
|
+
### Migration
|
|
17
|
+
|
|
18
|
+
In each governed repository, run:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git rm .github/carson-instructions.md
|
|
22
|
+
carson template apply
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`carson template apply` writes the new `carson.md` and updates the pointer files. The old `carson-instructions.md` must be removed manually — Carson will not delete it automatically.
|
|
26
|
+
|
|
27
|
+
## 2.13.2 — Docs Refresh
|
|
28
|
+
|
|
29
|
+
### What changed
|
|
30
|
+
|
|
31
|
+
- Updated `docs/define.md`: added missing in-scope commands (`govern`, `housekeep`, `refresh --all`, `lint policy`); corrected out-of-scope merge authority statement.
|
|
32
|
+
- 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.
|
|
33
|
+
- Updated `API.md`: added `govern` config schema and environment overrides.
|
|
34
|
+
|
|
8
35
|
## 2.13.1 — Guided Governance Registration
|
|
9
36
|
|
|
10
37
|
### What changed
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.13.
|
|
1
|
+
2.13.3
|
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
|
|
11
|
-
spec.description = "Carson lives outside the repositories it governs. On every commit
|
|
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"
|
data/lib/carson/config.rb
CHANGED
|
@@ -48,7 +48,7 @@ module Carson
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"template" => {
|
|
51
|
-
"managed_files" => [ ".github/carson
|
|
51
|
+
"managed_files" => [ ".github/carson.md", ".github/copilot-instructions.md", ".github/CLAUDE.md", ".github/AGENTS.md", ".github/pull_request_template.md", ".github/workflows/carson-lint.yml" ]
|
|
52
52
|
},
|
|
53
53
|
"lint" => {
|
|
54
54
|
"policy_source" => "wanghailei/lint.git"
|
data/lib/carson/runtime/local.rb
CHANGED
|
@@ -188,7 +188,7 @@ module Carson
|
|
|
188
188
|
puts_line ""
|
|
189
189
|
puts_line "Onboarding #{repo_name}..."
|
|
190
190
|
|
|
191
|
-
|
|
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
|
data/lib/carson/runtime/setup.rb
CHANGED
|
@@ -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.
|
|
361
|
+
puts_line "Skipped. Run carson onboard here again to register later."
|
|
362
362
|
end
|
|
363
363
|
end
|
|
364
364
|
|
data/templates/.github/AGENTS.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Read `.github/carson
|
|
1
|
+
Read `.github/carson.md` for repository governance rules enforced by Carson.
|
data/templates/.github/CLAUDE.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Read `.github/
|
|
1
|
+
Read `.github/AGENTS.md` for repository governance rules enforced by Carson.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Carson Governance
|
|
2
|
+
|
|
3
|
+
This repository is governed by [Carson](https://github.com/wanghailei/carson), an autonomous governance runtime. Carson lives on the maintainer's workstation, not inside this repository.
|
|
4
|
+
|
|
5
|
+
## What Carson Does Not Do
|
|
6
|
+
|
|
7
|
+
Carson has no `commit`, `push`, or `pr` commands. Use `git` and `gh` for those. Carson audits and governs; you execute.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
**Before committing:**
|
|
12
|
+
```bash
|
|
13
|
+
carson audit # full governance check — run before every commit
|
|
14
|
+
carson template check # detect drift in .github/* managed files
|
|
15
|
+
carson template apply # fix drift if detected
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Before recommending merge:**
|
|
19
|
+
```bash
|
|
20
|
+
carson review gate # block until actionable review findings are resolved
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Branch housekeeping:**
|
|
24
|
+
```bash
|
|
25
|
+
carson sync # fast-forward local main from remote
|
|
26
|
+
carson prune # remove stale branches (safer than git branch -d on squash repos)
|
|
27
|
+
carson housekeep # sync + prune together
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Exit Codes
|
|
31
|
+
|
|
32
|
+
- `0` — success
|
|
33
|
+
- `1` — runtime or configuration error
|
|
34
|
+
- `2` — policy blocked (hard stop; treat as expected failure in CI)
|
|
35
|
+
|
|
36
|
+
## Governance Rules
|
|
37
|
+
|
|
38
|
+
- Before commit and before push, run `carson audit`.
|
|
39
|
+
- At session start and again immediately before merge recommendation, run `gh pr list --state open --limit 50` and re-confirm active PR priorities.
|
|
40
|
+
- Before merge recommendation, run `carson review gate`; it enforces warm-up wait, unresolved-thread convergence, and `Disposition:` acknowledgements for actionable top-level findings.
|
|
41
|
+
- Actionable findings are unresolved review threads, any non-author `CHANGES_REQUESTED` review, or non-author comments/reviews with risk keywords (`bug`, `security`, `incorrect`, `block`, `fail`, `regression`).
|
|
42
|
+
- `Disposition:` responses must include one token (`accepted`, `rejected`, `deferred`) and the target review URL.
|
|
43
|
+
- Scheduled governance runs `carson review sweep` every 8 hours to track late actionable review activity.
|
|
44
|
+
- Do not treat green checks or `mergeStateStatus: CLEAN` as sufficient if unresolved review threads remain.
|
|
45
|
+
- Never suggest destructive operations on protected refs (`main`/`master`, local or remote).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Read `.github/
|
|
1
|
+
Read `.github/AGENTS.md` for repository governance rules enforced by Carson.
|
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.
|
|
4
|
+
version: 2.13.3
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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:
|
|
@@ -61,7 +63,7 @@ files:
|
|
|
61
63
|
- lib/carson/version.rb
|
|
62
64
|
- templates/.github/AGENTS.md
|
|
63
65
|
- templates/.github/CLAUDE.md
|
|
64
|
-
- templates/.github/carson
|
|
66
|
+
- templates/.github/carson.md
|
|
65
67
|
- templates/.github/copilot-instructions.md
|
|
66
68
|
- templates/.github/pull_request_template.md
|
|
67
69
|
- templates/.github/workflows/carson-lint.yml
|
|
@@ -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
|
|
97
|
-
|
|
98
|
+
summary: Autonomous repository governance — you write the code, Carson manages everything
|
|
99
|
+
else.
|
|
98
100
|
test_files: []
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
## Shared Governance Baseline
|
|
2
|
-
|
|
3
|
-
- GitHub rulesets and required checks are merge authority.
|
|
4
|
-
- Carson runs as an outsider runtime for hook health, main sync, scope integrity, and gh visibility.
|
|
5
|
-
- Before commit and before push, run `carson audit`.
|
|
6
|
-
- At session start and again immediately before merge recommendation, run `gh pr list --state open --limit 50` and re-confirm active PR priorities.
|
|
7
|
-
- Before merge recommendation, run `carson review gate`; it enforces warm-up wait, unresolved-thread convergence, and `Disposition:` dispositions for actionable top-level findings.
|
|
8
|
-
- Actionable findings are unresolved review threads, any non-author `CHANGES_REQUESTED` review, or non-author comments/reviews with risk keywords (`bug`, `security`, `incorrect`, `block`, `fail`, `regression`).
|
|
9
|
-
- `Disposition:` dispositions must include one token (`accepted`, `rejected`, `deferred`) and the target review URL.
|
|
10
|
-
- Scheduled governance runs `carson review sweep` every 8 hours to track late actionable review activity on recent open/closed PRs.
|
|
11
|
-
- Do not treat green checks or `mergeStateStatus: CLEAN` as sufficient if unresolved review threads remain.
|
|
12
|
-
- Never suggest destructive operations on protected refs (`main`/`master`, local or remote).
|