carson 3.30.1 → 3.30.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f1c9bdf439edf6f4c50dbf4c2640ec87cf0cf7f5aacd7960d16c2d32600a0c3
4
- data.tar.gz: b82620a9e4524b9e08c7851f9de133967ce64284c7d2c57a71d87df7055ce8a1
3
+ metadata.gz: 414294f12e0a6e1560b7c60df2ee77676734a63f279e40675bd4d10b55660851
4
+ data.tar.gz: 2dafbe3def3939e75263fb47de9e474d073f083adbb8fb22ec997ff839727768
5
5
  SHA512:
6
- metadata.gz: 9433570c67b8f8b793eba64969356c6ec92775515e8291079518b0be7a4f051183eb20e19d23e0d6456a38a95c875f06d9e6d7536b434c30ec69fe36d63b0c4e
7
- data.tar.gz: 7b82e7e07750d8e0ac4d0502a95e86925e210c1cca5b0c0e33355604cc4910819f46c57b002c9b7d9fd8dd4c312b4bc4cfba26192875e1a23818498343a4b0d0
6
+ metadata.gz: fbc81621f5aa779bf26ef20316083c1e207266f99bbefaba4fa78eea4c475745c67f30410b66e4a29257ed88b54400068a8cfb6d40e1aabeda16615b9baad3bf
7
+ data.tar.gz: 973068e6d3e716f44e7a86fed848eeab6c5f26b95839e414061ed9f745ef5ed79a000ec60d753294cd27844bd6878beb14c3739ac24e4cdac04f2510592212d5
data/API.md CHANGED
@@ -5,20 +5,25 @@ For operational usage and daily workflows, see `MANUAL.md`.
5
5
 
6
6
  ## Command interface
7
7
 
8
- Command form:
8
+ Two-tier grammar:
9
9
 
10
10
  ```bash
11
- carson <command> [subcommand] [arguments]
11
+ carson <command> # portfolio commands
12
+ carson <repo> <command> [arguments] # repo-scoped commands (or from CWD)
12
13
  ```
13
14
 
15
+ Portfolio commands: `list`, `onboard`, `offboard`, `refresh`, `version`.
16
+ Repo-scoped commands: `carson <repo> <command>` or `carson <command>` when CWD is inside a governed repo.
17
+
14
18
  ### Setup commands
15
19
 
16
20
  | Command | Purpose |
17
21
  |---|---|
18
22
  | `carson setup` | Interactive quiz to configure remote, main branch, workflow, and canonical lint-policy path. Writes `~/.carson/config.json`. |
19
- | `carson onboard [repo_path]` | Apply one-command baseline setup for a target git repository. Auto-triggers `setup` on first run. Installs or refreshes Carson-managed global hooks. |
20
- | `carson refresh [repo_path]` | Re-apply hooks, templates, and audit after upgrading Carson. Auto-propagates template updates to the remote via worktree (branch workflow: PR on `carson/template-sync`; trunk workflow: push to main). |
21
- | `carson offboard [repo_path]` | Remove Carson-managed host artefacts, detach Carson hooks path, and deregister from `govern.repos`. |
23
+ | `carson onboard <repo_path>` | Apply one-command baseline setup for a target git repository. Auto-triggers `setup` on first run. Installs or refreshes Carson-managed global hooks. |
24
+ | `carson refresh` | Re-apply hooks, templates, and audit across all governed repos after upgrading Carson. Auto-propagates template updates to the remote via worktree (branch workflow: PR on `carson/template-sync`; trunk workflow: push to main). Skips repos with active worktrees or uncommitted changes. |
25
+ | `carson offboard <repo_path>` | Remove Carson-managed host artefacts, detach Carson hooks path, and deregister from `govern.repos`. |
26
+ | `carson list [--json]` | List all governed repositories. |
22
27
 
23
28
  ### Daily commands
24
29
 
@@ -38,33 +43,17 @@ carson <command> [subcommand] [arguments]
38
43
  | `carson worktree list [--json]` | Show every registered worktree with PR state and Carson's cleanup recommendation. |
39
44
  | `carson worktree remove <path_or_name>` | Remove a worktree safely and clean up its branch when allowed. |
40
45
 
41
- ### Batch commands (Layer 2)
42
-
43
- All batch commands operate across every governed repository registered in `govern.repos`.
44
-
45
- | Command | Purpose |
46
- |---|---|
47
- | `carson refresh --all` | Re-apply hooks, templates, and audit across all governed repos. Skips repos with active worktrees or uncommitted changes. |
48
- | `carson audit --all` | Run governance audit across all governed repos. Reports pass/block/fail per repo. |
49
- | `carson sync --all` | Sync main branch across all governed repos. |
50
- | `carson prune --all` | Remove stale branches across all governed repos. |
51
- | `carson status --all [--json]` | Portfolio-wide delivery overview per governed repository. |
52
- | `carson template check --all` | Read-only template drift detection across all governed repos. |
53
- | `carson housekeep --all [--loop SECONDS]` | Attempt sync, then reap worktrees with strong abandonment evidence, reconcile integrated delivery worktree records from the ledger, and prune across all governed repos. Safe cleanup still runs when sync is blocked. |
54
-
55
- `--loop SECONDS` runs the housekeep cycle continuously, sleeping SECONDS between cycles. It requires `--all`, accepts only positive integers, and exits cleanly on `Ctrl-C` or `SIGTERM` with a cycle count summary.
56
-
57
- ### Govern commands
46
+ ### Receive commands
58
47
 
59
48
  | Command | Purpose |
60
49
  |---|---|
61
- | `carson govern [--dry-run] [--json] [--loop SECONDS]` | Portfolio-level delivery oversight: assess active deliveries, integrate ready branches, dispatch revisions, and escalate blocked work. Live integrated rows include merge proof. |
50
+ | `carson <repo> receive [--dry-run] [--json] [--loop SECONDS]` | Single-repo delivery triage: assess active deliveries, integrate ready branches, dispatch revisions, and escalate blocked work. Live integrated rows include merge proof. |
62
51
 
63
- `--loop SECONDS` runs the govern cycle continuously, sleeping SECONDS between cycles. The loop isolates errors per cycle — a single failing cycle does not stop the daemon. `Ctrl-C` or `SIGTERM` cleanly exits with a cycle count summary. SECONDS must be a positive integer.
52
+ `--loop SECONDS` runs the receive cycle continuously, sleeping SECONDS between cycles. The loop isolates errors per cycle — a single failing cycle does not stop the daemon. `Ctrl-C` or `SIGTERM` cleanly exits with a cycle count summary. SECONDS must be a positive integer.
64
53
 
65
54
  Governed integration is fixed to `squash`. Non-squash `govern.merge.method` values are rejected by config validation.
66
55
 
67
- After a live integration attempt, govern reports the actual outcome. Failed merges stay held at gate instead of being reported as integrated.
56
+ After a live integration attempt, receive reports the actual outcome. Failed merges stay held at gate instead of being reported as integrated.
68
57
 
69
58
  After CI and review pass, Carson still checks GitHub mergeability. Conflicting PRs exit as `Merge blocked` with an explicit merge-conflict summary. `BEHIND` is treated as freshness failure: Carson blocks and requires a branch refresh before it will continue.
70
59
 
@@ -93,9 +82,9 @@ In `--json` mode, `deliver` still suppresses human output. Every JSON result now
93
82
  }
94
83
  ```
95
84
 
96
- On `main`, `branch.merge_proof` is still present with `basis: "not_applicable"`. On non-main branches with no Carson delivery record, `branch.pull_request` and `branch.merge_proof` are `null`. `status --all` remains summary-only in v1 and does not include per-repo merge proof.
85
+ On `main`, `branch.merge_proof` is still present with `basis: "not_applicable"`. On non-main branches with no Carson delivery record, `branch.pull_request` and `branch.merge_proof` are `null`.
97
86
 
98
- After a successful govern merge, Carson runs the same cleanup path as `housekeep`: sync, reap safe worktrees, then prune.
87
+ After a successful receive merge, Carson runs the same cleanup path as `housekeep`: sync, reap safe worktrees, then prune.
99
88
 
100
89
  ### Review commands
101
90
 
data/MANUAL.md CHANGED
@@ -130,7 +130,7 @@ These strategies are the audit lens for Carson. If behaviour departs from them,
130
130
  - **Main-tree protection** — on the governed main working tree, Carson blocks `git add` and `git commit` until the agent creates a Carson worktree for the task.
131
131
  - **Governed delivery** — completed work returns to shared truth through remote `main` via PR-based delivery. Carson owns the landing path.
132
132
  - **Active review gating** — when the repo uses PR-based delivery, review findings must be acknowledged before merge. Feedback is never silently buried.
133
- - **Portfolio triage** — `carson govern` applies the same discipline across multiple repositories: classify, merge, dispatch, or escalate.
133
+ - **Portfolio triage** — `carson receive` applies the same discipline across multiple repositories: classify, merge, dispatch, or escalate.
134
134
  - **Template propagation** — Carson treats canonical policy files as managed infrastructure and keeps them consistent across repos.
135
135
 
136
136
  ### Safety Strategies
@@ -166,11 +166,11 @@ carson deliver --commit "fix: describe this delivery"
166
166
  # Output: merged into main, or an explicit deferred/blocked handoff
167
167
  ```
168
168
 
169
- **4. Inspect or wait when needed** — when `deliver` cannot merge immediately, Carson tells you whether the PR was deferred or blocked, whether merge was attempted, and which command to run next. `status` still shows the current branch, the next queued delivery, and blocked-delivery summaries for the repository. When the current branch has a Carson delivery record, `status` also shows Carson's last observed PR state and merge proof. Keep `govern` running when you want unattended portfolio reassessment and revision dispatch across governed repositories:
169
+ **4. Inspect or wait when needed** — when `deliver` cannot merge immediately, Carson tells you whether the PR was deferred or blocked, whether merge was attempted, and which command to run next. `status` still shows the current branch, the next queued delivery, and blocked-delivery summaries for the repository. When the current branch has a Carson delivery record, `status` also shows Carson's last observed PR state and merge proof. Keep `receive` running when you want unattended portfolio reassessment and revision dispatch across governed repositories:
170
170
 
171
171
  ```bash
172
172
  carson status
173
- carson govern --loop 300
173
+ carson receive --loop 300
174
174
  ```
175
175
 
176
176
  ### Recover a baseline-red governance check
@@ -280,28 +280,18 @@ carson review gate
280
280
  **Portfolio overview:**
281
281
 
282
282
  ```bash
283
- carson repos # list all governed repositories
284
- carson repos --json # machine-readable output
285
- carson status --all # branch, worktrees, governance per repo
283
+ carson list # list all governed repositories
284
+ carson list --json # machine-readable output
286
285
  ```
287
286
 
288
- **Portfolio maintenance (Layer 2):**
289
-
290
- All `--all` commands run across every governed repository registered via `carson onboard`.
287
+ **Portfolio maintenance:**
291
288
 
292
289
  ```bash
293
- carson refresh --all # re-apply hooks, templates, audit across all repos
294
- carson sync --all # fast-forward main across all repos
295
- carson audit --all # governance audit across all repos
296
- carson prune --all # remove stale branches across all repos
297
- carson template check --all # detect template drift across all repos
298
- carson housekeep --all # full maintenance cycle across all repos
299
- carson housekeep --all --loop 300 # housekeep every 5 minutes
290
+ carson refresh # re-apply hooks, templates, audit across all repos
291
+ carson list # list all governed repositories
300
292
  ```
301
293
 
302
- `refresh --all` checks each repo for safety before operating: repos with active worktrees or uncommitted changes are skipped with clear reasons. Other batch commands attempt each repo and report failures without stopping.
303
-
304
- `housekeep --all --loop SECONDS` runs the full housekeep cycle continuously, sleeping SECONDS between passes. It requires `--all`, accepts only positive integers, and exits cleanly on `Ctrl-C` or `SIGTERM` with a cycle count summary.
294
+ `refresh` checks each repo for safety before operating: repos with active worktrees or uncommitted changes are skipped with clear reasons. Use `carson list --json` to script batch operations across governed repositories.
305
295
 
306
296
  **Periodic maintenance:**
307
297
 
@@ -310,28 +300,28 @@ carson review sweep # update tracking issue for late review feedback
310
300
  carson prune # remove stale local branches
311
301
  ```
312
302
 
313
- ## Running Carson Govern Continuously
303
+ ## Running Carson Receive Continuously
314
304
 
315
- Use `--loop SECONDS` to run `carson govern` as a persistent daemon that cycles on a schedule:
305
+ Use `--loop SECONDS` to run `carson receive` as a persistent daemon that cycles on a schedule:
316
306
 
317
307
  ```bash
318
- carson govern --loop 300 # cycle every 5 minutes
319
- carson govern --loop 300 --dry-run # observe mode, no integration or revision dispatch
308
+ carson receive --loop 300 # cycle every 5 minutes
309
+ carson receive --loop 300 --dry-run # observe mode, no integration or revision dispatch
320
310
  ```
321
311
 
322
312
  The loop is built-in and cross-platform — no cron, launchd, or Task Scheduler required. Run it in a terminal, tmux, screen, or as a system service.
323
313
 
324
314
  Each cycle runs independently: if one cycle fails (network error, GitHub API timeout), the error is logged and the next cycle proceeds normally. Press `Ctrl-C` or send `SIGTERM` to stop — Carson exits cleanly with a cycle count summary.
325
315
 
326
- ### Govern and Coding Agents
316
+ ### Receive and Coding Agents
327
317
 
328
- `carson govern` dispatches coding agents (Codex or Claude) when an active delivery is blocked by CI, review, or policy feedback. The agent receives the failure context and attempts a revision. If the agent succeeds, the delivery re-enters the governance pipeline. If it fails repeatedly or times out, the delivery is escalated for human attention.
318
+ `carson receive` dispatches coding agents (Codex or Claude) when an active delivery is blocked by CI, review, or policy feedback. The agent receives the failure context and attempts a revision. If the agent succeeds, the delivery re-enters the governance pipeline. If it fails repeatedly or times out, the delivery is escalated for human attention.
329
319
 
330
- After a live merge attempt, govern reports the actual outcome. Failed merges stay held at gate instead of being reported as integrated. Successful integrations also report merge proof for the landed branch.
320
+ After a live merge attempt, receive reports the actual outcome. Failed merges stay held at gate instead of being reported as integrated. Successful integrations also report merge proof for the landed branch.
331
321
 
332
322
  After CI and review pass, Carson still checks GitHub mergeability. Conflicting PRs exit as `Merge blocked` with an explicit merge-conflict summary. `BEHIND` is treated as a freshness failure, not a harmless squash detail: Carson blocks and requires a branch refresh before it will continue.
333
323
 
334
- After a successful govern merge, Carson runs the same cleanup path as `carson housekeep`: sync, reap safe worktrees, then prune.
324
+ After a successful receive merge, Carson runs the same cleanup path as `carson housekeep`: sync, reap safe worktrees, then prune.
335
325
 
336
326
  The agent provider is configurable via `govern.agent.provider` (`auto`, `codex`, or `claude`). In `auto` mode, Carson selects the first available provider.
337
327
 
@@ -467,8 +457,7 @@ carson template check
467
457
  ```
468
458
 
469
459
  **Hook version mismatch after upgrade**
470
- - Run `carson refresh` to re-apply hooks and templates for the new Carson version.
471
- - Run `carson refresh --all` to refresh all governed repositories at once.
460
+ - Run `carson refresh` to re-apply hooks and templates for all governed repositories.
472
461
 
473
462
  **Template auto-propagation**
474
463
 
@@ -487,7 +476,7 @@ To retire Carson from a repository:
487
476
  carson offboard /path/to/your-repo
488
477
  ```
489
478
 
490
- This removes Carson-managed host artefacts, unsets `core.hooksPath` when it points to Carson-managed global hooks, and deregisters the repository from `govern.repos` so `carson govern` and `carson refresh --all` no longer target it.
479
+ This removes Carson-managed host artefacts, unsets `core.hooksPath` when it points to Carson-managed global hooks, and deregisters the repository from `govern.repos` so `carson receive` and `carson refresh` no longer target it.
491
480
 
492
481
  ## Related Documents
493
482
 
data/README.md CHANGED
@@ -27,7 +27,7 @@ Carson lives on your workstation and in CI, never inside the repositories it gov
27
27
 
28
28
  ├─ hooks ──────────────► commit gates and command guards
29
29
  ├─ worktree flow ──────► create → work → deliver → housekeep
30
- └─ portfolio layer ────► status --all | refresh --all | govern
30
+ └─ portfolio layer ────► list | refresh | receive
31
31
  ```
32
32
 
33
33
  The outsider boundary still matters: Carson governs repositories without becoming a runtime dependency inside them.
@@ -75,12 +75,12 @@ When one Carson-governed required check is already red on the default branch and
75
75
  Single-repo depth comes first. Once multiple repositories are onboarded, the same discipline scales out across them:
76
76
 
77
77
  ```bash
78
- carson status --all
79
- carson refresh --all
80
- carson govern --dry-run
78
+ carson list
79
+ carson refresh
80
+ carson receive --dry-run
81
81
  ```
82
82
 
83
- `carson govern` is the portfolio layer. It assesses active deliveries across governed repositories, integrates ready branches, dispatches revisions for blocked work, and escalates what still needs human judgement. Governed integration is squash-only and happens one repository at a time.
83
+ `carson <repo> receive` triages active deliveries for one repository: integrates ready branches, dispatches revisions for blocked work, and escalates what still needs human judgement. Governed integration is squash-only. Use `carson list --json` to script receive across your portfolio.
84
84
 
85
85
  ## Where to Read Next
86
86
 
data/RELEASE.md CHANGED
@@ -5,6 +5,40 @@ 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
+ ## Unreleased
9
+
10
+ ### Breaking
11
+
12
+ - CLI grammar is now two-tier: portfolio commands (`list`, `onboard`, `offboard`, `refresh`, `version`) and repo-scoped commands (`carson <repo> <command>` or `carson <command>` from CWD)
13
+ - `govern` renamed to `receive` — single-repo only, no portfolio iteration
14
+ - `repos` renamed to `list`
15
+ - `--all` removed from all repo commands; use `carson list --json` to script batch operations
16
+ - `refresh` is now portfolio-only (always refreshes all governed repos)
17
+
18
+ ## 3.30.3
19
+
20
+ ### What changed
21
+
22
+ - **Worktree branch resolution fixed** — `carson deliver` (and all other repo commands) now correctly resolve the current branch when running from inside a worktree. Previously, the CLI canonicalised the worktree path to the main tree root, causing the Git adapter to run all commands from the main tree. This meant `current_branch` returned `main` instead of the worktree's branch, blocking delivery with a false "cannot deliver from main" error.
23
+ - **`onboard`/`offboard` use specified repo path** — Portfolio commands with a `<repo_path>` argument now use that path for the Runtime, not the invoking CWD. Previously the argument was parsed but ignored.
24
+ - **`main_worktree_context?` correctly detects worktrees** — The dirty-tree audit guard now compares the actual working directory against the main worktree root, preventing false "main working tree has uncommitted changes" blocks when working in a worktree.
25
+ - **CI smoke tests aligned with CWD governance** — All smoke test repos are now registered as governed, `offboard` calls pass the required `<repo_path>` argument, and legacy `govern` references are updated to `receive`.
26
+
27
+ ### No migration required
28
+
29
+ - Existing workflows continue to work unchanged.
30
+
31
+ ## 3.30.2
32
+
33
+ ### What changed
34
+
35
+ - **Recovery hints re-enter through Carson, not blocked raw commands** — Delivery error recovery messages no longer suggest raw `gh pr create`, `gh pr merge`, or `git rebase` commands. All recovery paths now guide the user back through Carson. Freshness blocks say "refresh this branch onto the target, then `carson deliver`" instead of teaching raw git recipes.
36
+ - **Fast PR indentation guard restored** — The Ruby indentation guard in CI now correctly handles access modifier detection, fixing false positives that blocked PRs.
37
+
38
+ ### No migration required
39
+
40
+ - Existing workflows continue to work unchanged.
41
+
8
42
  ## 3.30.1
9
43
 
10
44
  ### What changed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.30.1
1
+ 3.30.3
data/carson.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = [ "carson" ]
30
30
  spec.require_paths = [ "lib" ]
31
31
  spec.add_dependency "sqlite3", ">= 1.3", "< 3"
32
- spec.files = Dir.glob( "{lib,exe,templates,hooks}/**/*", File::FNM_DOTMATCH ).select { |path| File.file?( path ) } + [
32
+ spec.files = Dir.glob( "{lib,exe,templates,config}/**/*", File::FNM_DOTMATCH ).select { |path| File.file?( path ) } + [
33
33
  ".github/workflows/carson_policy.yml",
34
34
  "README.md",
35
35
  "MANUAL.md",