carson 2.15.2 → 2.15.4
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/RELEASE.md +22 -1
- data/VERSION +1 -1
- data/carson.gemspec +1 -1
- data/hooks/pre-merge-commit +3 -0
- data/hooks/prepare-commit-msg +3 -0
- data/lib/carson/runtime/audit.rb +8 -0
- data/lib/carson/runtime.rb +6 -0
- data/templates/.github/workflows/carson-lint.yml +0 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1aaa71b00dc2ea0269042f7389a9b2d3fda1cf3d91b77832d3555dfd2b25f680
|
|
4
|
+
data.tar.gz: 657626d6700eb16f8640c753e4b7d1e7dddd37d358bdfa6df5bd1e2dd3400d79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74e9840537605c3e3a75c5b6ad26eb76f06e9f8d9b2cdf564a5b7034fec10187a02e07b51c653a56351eaa4a3f4e58c99eef20a7f876fb75af854247521f829d
|
|
7
|
+
data.tar.gz: 2f79700321e7e920695116f9780f6a64fa7259bc147e9d57e85bc472dfd5adc25b0ab48eefd38b9e5c7863423ac1b6d224fa7d6c56c887f9db6c8ca856d03c14
|
data/RELEASE.md
CHANGED
|
@@ -5,6 +5,27 @@ 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.4 — Lint Workflow Fix
|
|
9
|
+
|
|
10
|
+
### What changed
|
|
11
|
+
|
|
12
|
+
- Removed explicit `LINTER_RULES_PATH: .github/linters` from the Carson Lint workflow template. MegaLinter v8 crashes with `ValueError` when the directory does not exist. The path is already MegaLinter's default — omitting it lets MegaLinter use `.github/linters/` when present and silently skip when absent.
|
|
13
|
+
|
|
14
|
+
### Migration
|
|
15
|
+
|
|
16
|
+
Run `carson refresh` in governed repositories to pick up the updated workflow.
|
|
17
|
+
|
|
18
|
+
## 2.15.3 — Initial Commit Guard
|
|
19
|
+
|
|
20
|
+
### What changed
|
|
21
|
+
|
|
22
|
+
- `carson audit` and `carson check` now return success in repositories with no commits (HEAD does not exist). Previously, the pre-commit hook called `git rev-parse --abbrev-ref HEAD` which crashed, creating a chicken-and-egg problem that blocked the very first commit.
|
|
23
|
+
- Shell hooks (`prepare-commit-msg`, `pre-merge-commit`) now exit cleanly when HEAD is absent, allowing the initial commit without `--no-verify`.
|
|
24
|
+
|
|
25
|
+
### No migration required
|
|
26
|
+
|
|
27
|
+
Run `carson prepare` in existing repositories to refresh hooks. No configuration changes needed.
|
|
28
|
+
|
|
8
29
|
## 2.15.2 — Release Guard
|
|
9
30
|
|
|
10
31
|
### What changed
|
|
@@ -43,7 +64,7 @@ No configuration or workflow changes needed.
|
|
|
43
64
|
|
|
44
65
|
### No migration required
|
|
45
66
|
|
|
46
|
-
Run `
|
|
67
|
+
Run `carson prepare` in each governed repo to pick up the updated pre-push hook.
|
|
47
68
|
|
|
48
69
|
## 2.14.2 — Docs Enrichment
|
|
49
70
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.15.
|
|
1
|
+
2.15.4
|
data/carson.gemspec
CHANGED
|
@@ -5,7 +5,7 @@ require_relative "lib/carson/version"
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "carson"
|
|
7
7
|
spec.version = Carson::VERSION
|
|
8
|
-
spec.authors = [ "Hailei Wang" ]
|
|
8
|
+
spec.authors = [ "Hailei Wang", "Codex", "Claude Code" ]
|
|
9
9
|
spec.email = [ "wanghailei@users.noreply.github.com" ]
|
|
10
10
|
spec.summary = "Autonomous repository governance — you write the code, Carson manages everything else."
|
|
11
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."
|
data/hooks/pre-merge-commit
CHANGED
|
@@ -5,6 +5,9 @@ hooks_dir="$(cd "$(dirname "$0")" && pwd)"
|
|
|
5
5
|
style="$(cat "$hooks_dir/workflow_style" 2>/dev/null || echo "branch")"
|
|
6
6
|
[ "$style" = "trunk" ] && exit 0
|
|
7
7
|
|
|
8
|
+
# Allow the very first commit in a new repository (HEAD does not exist yet).
|
|
9
|
+
git rev-parse --verify HEAD >/dev/null 2>&1 || exit 0
|
|
10
|
+
|
|
8
11
|
branch_name="$(git rev-parse --abbrev-ref HEAD)"
|
|
9
12
|
if [[ "$branch_name" == "main" || "$branch_name" == "master" ]]; then
|
|
10
13
|
echo "Carson policy: direct merge commits on ${branch_name} are blocked. Merge through a pull request." >&2
|
data/hooks/prepare-commit-msg
CHANGED
|
@@ -5,6 +5,9 @@ hooks_dir="$(cd "$(dirname "$0")" && pwd)"
|
|
|
5
5
|
style="$(cat "$hooks_dir/workflow_style" 2>/dev/null || echo "branch")"
|
|
6
6
|
[ "$style" = "trunk" ] && exit 0
|
|
7
7
|
|
|
8
|
+
# Allow the very first commit in a new repository (HEAD does not exist yet).
|
|
9
|
+
git rev-parse --verify HEAD >/dev/null 2>&1 || exit 0
|
|
10
|
+
|
|
8
11
|
branch_name="$(git rev-parse --abbrev-ref HEAD)"
|
|
9
12
|
if [[ "$branch_name" == "main" || "$branch_name" == "master" ]]; then
|
|
10
13
|
echo "Carson policy: direct commits on ${branch_name} are blocked. Work on a feature branch and merge via PR." >&2
|
data/lib/carson/runtime/audit.rb
CHANGED
|
@@ -6,6 +6,10 @@ module Carson
|
|
|
6
6
|
def audit!
|
|
7
7
|
fingerprint_status = block_if_outsider_fingerprints!
|
|
8
8
|
return fingerprint_status unless fingerprint_status.nil?
|
|
9
|
+
unless head_exists?
|
|
10
|
+
puts_line "No commits yet — audit skipped for initial commit."
|
|
11
|
+
return EXIT_OK
|
|
12
|
+
end
|
|
9
13
|
audit_state = "ok"
|
|
10
14
|
audit_concise_problems = []
|
|
11
15
|
puts_verbose ""
|
|
@@ -77,6 +81,10 @@ module Carson
|
|
|
77
81
|
# Thin focused command: show required-check status for the current branch's open PR.
|
|
78
82
|
# Always exits 0 for pending or passing so callers never see a false "Error: Exit code 8".
|
|
79
83
|
def check!
|
|
84
|
+
unless head_exists?
|
|
85
|
+
puts_line "Checks: no commits yet."
|
|
86
|
+
return EXIT_OK
|
|
87
|
+
end
|
|
80
88
|
unless gh_available?
|
|
81
89
|
puts_line "Checks: gh CLI not available."
|
|
82
90
|
return EXIT_ERROR
|
data/lib/carson/runtime.rb
CHANGED
|
@@ -60,6 +60,12 @@ module Carson
|
|
|
60
60
|
@out, @err = saved_out, saved_err
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
# Returns true when the repository has at least one commit (HEAD exists).
|
|
64
|
+
def head_exists?
|
|
65
|
+
_, _, success, = git_run( "rev-parse", "--verify", "HEAD" )
|
|
66
|
+
success
|
|
67
|
+
end
|
|
68
|
+
|
|
63
69
|
# Current local branch name.
|
|
64
70
|
def current_branch
|
|
65
71
|
git_capture!( "rev-parse", "--abbrev-ref", "HEAD" ).strip
|
metadata
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: carson
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.15.
|
|
4
|
+
version: 2.15.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hailei Wang
|
|
8
|
+
- Codex
|
|
9
|
+
- Claude Code
|
|
8
10
|
bindir: exe
|
|
9
11
|
cert_chain: []
|
|
10
12
|
date: 1980-01-02 00:00:00.000000000 Z
|