carson 2.15.0 → 2.15.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: e14a15b6d3d91c0bbf75d0b3652a65ee7339b2c2cdeb56cd0937efe94f90c584
4
- data.tar.gz: 1b08caaaf7a4e453ce55256eca2c961b09ffaaae761a6be101e10e3ab0f61397
3
+ metadata.gz: f9e5677b6e4929ae5157a42c54ea9c72134695d7ec117f5173040eb2b37b8f52
4
+ data.tar.gz: 5184adc9c300945bc2e8f8cb524ce2403d69be2705142dc9134dc42deba979c9
5
5
  SHA512:
6
- metadata.gz: d594bcef84c8aa142438ef8b625c71f38366bb19e4a7a8abc48b415b882946b93845d226cac1eecc08a316b94677b8bcdf02edcdb9eac70a55f1f85fd800922b
7
- data.tar.gz: 02ea0cc8507330c1dbb8e7e1b6a1f8e4f3a88f0d9aa396b296251cbd70fe916f4fcdb7b564301427d6911052376071f35098e34021c19cb6c28e7d05c84a0f79
6
+ metadata.gz: fc82d8e07668b795d75c881d213677faedc7de0d4936ee9f4212cb81df441853a6cc049ecf99ea2f2a67907e0328d8be6ca44b0c580dad61a20e503bd285b57f
7
+ data.tar.gz: 4fa1fd958283661c7206ecec2ed33228fe0d55462c11d05b61be50050499c8bafc2cd716ab32b0081361f382e7de22e929bd347726423a06c9ee1473898a9e48
data/API.md CHANGED
@@ -56,6 +56,7 @@ carson <command> [subcommand] [arguments]
56
56
  |---|---|
57
57
  | `carson version` | Print installed Carson version. |
58
58
  | `carson inspect` | Verify Carson-managed hook installation and repository setup. |
59
+ | `carson check` | Report required CI check status for the current branch's open PR. Exits 0 for passing or pending; exits 2 for failing. Never exits 8. |
59
60
 
60
61
  ## Exit status contract
61
62
 
@@ -118,7 +119,7 @@ Environment overrides:
118
119
  },
119
120
  "check_wait": 30,
120
121
  "merge": {
121
- "authority": false,
122
+ "authority": true,
122
123
  "method": "squash"
123
124
  }
124
125
  }
@@ -130,7 +131,7 @@ Environment overrides:
130
131
  - `agent.provider`: `"auto"`, `"codex"`, or `"claude"`.
131
132
  - `agent.codex` / `agent.claude`: provider-specific options (reserved).
132
133
  - `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.authority`: `true` (default) — Carson may merge autonomously. Set to `false` to require explicit enablement.
134
135
  - `merge.method`: `"squash"` (default), `"merge"`, or `"rebase"`.
135
136
 
136
137
  `lint` schema:
data/RELEASE.md CHANGED
@@ -5,6 +5,57 @@ 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.15.2 — Release Guard
9
+
10
+ ### What changed
11
+
12
+ - `release.yml` now fails with a clear error if `RELEASE.md` is missing an entry for the version being released. Previously it silently fell back to `"Release $version"`, creating GitHub Releases with no content.
13
+ - Recovery path: add the missing `RELEASE.md` entry in a commit, then re-dispatch the release workflow manually via `workflow_dispatch`.
14
+
15
+ ### No migration required
16
+
17
+ No configuration or workflow changes needed.
18
+
19
+ ## 2.15.1 — Codex Review Fixes
20
+
21
+ ### What changed
22
+
23
+ - `carson check` now correctly exits 2 for cancelled, errored, or timed-out CI checks. Previously, only `fail`-bucketed checks were treated as failing — all other non-passing states (cancelled, error) fell through to "all passing".
24
+ - Pre-push auto-commit now aborts the in-flight push and prints "Push again to include them." Previously the commit was created locally but not included in the push that triggered it.
25
+ - `--push-prep` now stages and commits untracked managed files. Previously, new managed files introduced by a gem upgrade were silently omitted.
26
+ - `API.md`: `merge.authority` default corrected from `false` to `true` to match the implementation.
27
+ - `API.md`: `carson check` added to the Info commands table.
28
+ - `docs/develop.md`: Architecture rationale updated — `govern.rb` acknowledged as a known exception to the adapter shell-out rule.
29
+ - Test coverage added for `check` bucket classification, `managed_dirty_paths` untracked handling, and CLI dispatch.
30
+
31
+ ### No migration required
32
+
33
+ No configuration or workflow changes needed.
34
+
35
+ ## 2.15.0 — JIT Auto-Commit on Pre-Push + `carson check`
36
+
37
+ ### What changed
38
+
39
+ - Pre-push hook now calls `carson template apply --push-prep` automatically. Any uncommitted changes to Carson-managed template files or `.github/linters/` are committed before the push reaches GitHub — no manual `git add` / `git commit` needed after a gem upgrade or `lint policy` run.
40
+ - `--push-prep` flag scopes the behaviour to pre-push only; interactive `carson template apply` is unchanged.
41
+ - `carson check` command added: wraps `gh pr checks --required`, exits 0 for pending or passing and 2 for failing. Useful for callers that need a clean CI status signal without `gh`'s confusing "Error: Exit code 8" for pending runs.
42
+ - CI smoke tests guarded against live audit exit codes with `|| true` so a pending or failing CI run on the default branch does not cause false test failures.
43
+
44
+ ### No migration required
45
+
46
+ Run `bash install.sh` to pick up the updated pre-push hook in all governed repos.
47
+
48
+ ## 2.14.2 — Docs Enrichment
49
+
50
+ ### What changed
51
+
52
+ - `docs/design.md` enriched with signal system, output design, prompt principles, and vocabulary guide.
53
+ - `docs/develop.md` enriched with architecture rationale, new-command walkthrough, and testing approach.
54
+
55
+ ### No migration required
56
+
57
+ Documentation only. No behavioural changes.
58
+
8
59
  ## 2.14.1 — Auto-Refresh on Install
9
60
 
10
61
  ### What changed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.15.0
1
+ 2.15.2
@@ -104,8 +104,8 @@ module Carson
104
104
  end
105
105
 
106
106
  checks_data = JSON.parse( checks_stdout )
107
- failing = checks_data.select { |e| e[ "bucket" ].to_s == "fail" || e[ "state" ].to_s.upcase == "FAILURE" }
108
107
  pending = checks_data.select { |e| e[ "bucket" ].to_s == "pending" }
108
+ failing = checks_data.select { |e| check_entry_failing?( entry: e ) }
109
109
  total = checks_data.count
110
110
  # gh exits 8 when required checks are still pending (not a failure).
111
111
  is_pending = !checks_success && checks_exit == 8
@@ -181,8 +181,8 @@ module Carson
181
181
  return report
182
182
  end
183
183
  checks_data = JSON.parse( checks_stdout )
184
- failing = checks_data.select { |entry| entry[ "bucket" ].to_s == "fail" || entry[ "state" ].to_s.upcase == "FAILURE" }
185
184
  pending = checks_data.select { |entry| entry[ "bucket" ].to_s == "pending" }
185
+ failing = checks_data.select { |entry| check_entry_failing?( entry: entry ) }
186
186
  report[ :checks ][ :status ] = checks_success ? "ok" : ( checks_exit == 8 ? "pending" : "attention" )
187
187
  report[ :checks ][ :required_total ] = checks_data.count
188
188
  report[ :checks ][ :failing_count ] = failing.count
@@ -361,6 +361,12 @@ module Carson
361
361
  [ critical, advisory ]
362
362
  end
363
363
 
364
+ # Returns true when a required-check entry is in a non-passing, non-pending state.
365
+ # Cancelled, errored, timed-out, and any unknown bucket all count as failing.
366
+ def check_entry_failing?( entry: )
367
+ !%w[pass pending].include?( entry[ "bucket" ].to_s )
368
+ end
369
+
364
370
  # Failing means completed with a non-successful conclusion.
365
371
  def default_branch_check_run_failing?( entry: )
366
372
  status = entry[ "status" ].to_s.strip.downcase
@@ -416,7 +416,7 @@ module Carson
416
416
  end
417
417
  return EXIT_ERROR if error_count.positive?
418
418
 
419
- push_prep_commit! if push_prep
419
+ return EXIT_BLOCK if push_prep && push_prep_commit!
420
420
  EXIT_OK
421
421
  end
422
422
 
@@ -754,7 +754,8 @@ module Carson
754
754
 
755
755
  git_system!( "add", *dirty )
756
756
  git_system!( "commit", "-m", "chore: sync Carson managed files" )
757
- puts_line "Carson committed managed file updates."
757
+ puts_line "Carson committed managed file updates. Push again to include them."
758
+ true
758
759
  end
759
760
 
760
761
  def managed_dirty_paths
@@ -767,7 +768,6 @@ module Carson
767
768
 
768
769
  stdout_text, = git_capture_soft( "status", "--porcelain", "--", *candidates )
769
770
  stdout_text.to_s.lines
770
- .reject { |l| l.start_with?( "??" ) }
771
771
  .map { |l| l[ 3.. ].strip }
772
772
  .reject( &:empty? )
773
773
  end
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.15.0
4
+ version: 2.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hailei Wang