@jeiemgi/cckit 0.6.1 → 0.7.0

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.
Files changed (114) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/AGENTS.md +34 -3
  3. package/README.md +86 -5
  4. package/bin/cckit +72 -3
  5. package/cckit.config.json +6 -1
  6. package/kit.config.schema.json +26 -1
  7. package/package.json +1 -1
  8. package/profiles/automation.json +2 -1
  9. package/profiles/content.json +2 -1
  10. package/profiles/minimal.json +2 -1
  11. package/profiles/research.json +2 -1
  12. package/profiles/software.json +2 -1
  13. package/scripts/init.sh +31 -1
  14. package/scripts/lib/board-view-test.sh +1 -0
  15. package/scripts/lib/board-view.sh +1 -0
  16. package/scripts/lib/captain-test.sh +62 -0
  17. package/scripts/lib/captain.sh +105 -17
  18. package/scripts/lib/cckit-output.sh +1 -0
  19. package/scripts/lib/commitlint.sh +1 -0
  20. package/scripts/lib/config-path-test.sh +1 -0
  21. package/scripts/lib/config-path.sh +1 -0
  22. package/scripts/lib/copilot-test.sh +1 -0
  23. package/scripts/lib/copilot.sh +1 -0
  24. package/scripts/lib/effort-dispatch-test.sh +10 -0
  25. package/scripts/lib/effort-flows-test.sh +1 -0
  26. package/scripts/lib/effort-metrics-test.sh +1 -0
  27. package/scripts/lib/effort-metrics.sh +1 -0
  28. package/scripts/lib/effort-ops-test.sh +360 -0
  29. package/scripts/lib/effort-ops.sh +372 -16
  30. package/scripts/lib/effort-parity-test.sh +1 -0
  31. package/scripts/lib/effort-plan.sh +1 -0
  32. package/scripts/lib/effort-slug-test.sh +32 -0
  33. package/scripts/lib/effort-slug.sh +72 -8
  34. package/scripts/lib/effort.sh +1 -0
  35. package/scripts/lib/engine-adapter.sh +1 -0
  36. package/scripts/lib/errors-header-test.sh +86 -0
  37. package/scripts/lib/gh-log.sh +1 -0
  38. package/scripts/lib/gh-project-test.sh +1 -0
  39. package/scripts/lib/gh-project.sh +1 -0
  40. package/scripts/lib/git-remote-test.sh +1 -0
  41. package/scripts/lib/git-remote.sh +1 -0
  42. package/scripts/lib/handoff.sh +23 -2
  43. package/scripts/lib/kit-brief-test.sh +292 -0
  44. package/scripts/lib/kit-brief.sh +376 -0
  45. package/scripts/lib/kit-cli-test.sh +1 -0
  46. package/scripts/lib/kit-cli.sh +1 -0
  47. package/scripts/lib/kit-config-resolve.sh +1 -0
  48. package/scripts/lib/kit-config-test.sh +14 -0
  49. package/scripts/lib/kit-config.sh +7 -0
  50. package/scripts/lib/kit-engine-test.sh +1 -0
  51. package/scripts/lib/kit-events.sh +1 -0
  52. package/scripts/lib/kit-gc-test.sh +125 -0
  53. package/scripts/lib/kit-gc.sh +193 -5
  54. package/scripts/lib/kit-interview-test.sh +1 -0
  55. package/scripts/lib/kit-interview.sh +1 -0
  56. package/scripts/lib/kit-lib-test.sh +226 -0
  57. package/scripts/lib/kit-lib.sh +308 -0
  58. package/scripts/lib/kit-local.sh +1 -0
  59. package/scripts/lib/kit-manifest.sh +1 -0
  60. package/scripts/lib/kit-mode-test.sh +1 -0
  61. package/scripts/lib/kit-mode.sh +1 -0
  62. package/scripts/lib/kit-msg-test.sh +1 -0
  63. package/scripts/lib/kit-msg.sh +1 -0
  64. package/scripts/lib/kit-operate.sh +1 -0
  65. package/scripts/lib/kit-profile-test.sh +1 -0
  66. package/scripts/lib/kit-profile.sh +1 -0
  67. package/scripts/lib/kit-state-test.sh +89 -0
  68. package/scripts/lib/kit-state.sh +61 -0
  69. package/scripts/lib/kit-status-test.sh +233 -0
  70. package/scripts/lib/kit-status.sh +415 -0
  71. package/scripts/lib/kit-task-ops-test.sh +1 -0
  72. package/scripts/lib/kit-task-ops.sh +1 -0
  73. package/scripts/lib/next.sh +1 -0
  74. package/scripts/lib/plan-machine-test.sh +54 -0
  75. package/scripts/lib/plan-machine.sh +86 -25
  76. package/scripts/lib/plan-next-test.sh +1 -0
  77. package/scripts/lib/plan-next.sh +1 -0
  78. package/scripts/lib/pr-evidence-test.sh +259 -0
  79. package/scripts/lib/pr-evidence.sh +220 -35
  80. package/scripts/lib/project-scan.sh +1 -0
  81. package/scripts/lib/react-detect.sh +1 -0
  82. package/scripts/lib/render-test.sh +1 -0
  83. package/scripts/lib/render.sh +1 -0
  84. package/scripts/lib/role-identity.sh +1 -0
  85. package/scripts/lib/secret-guard.sh +21 -1
  86. package/scripts/lib/toon.sh +1 -0
  87. package/scripts/lib/ui.sh +1 -0
  88. package/scripts/lib/version-bump-test.sh +1 -0
  89. package/scripts/lib/version-bump.sh +1 -0
  90. package/scripts/lib/worktree-bootstrap-test.sh +220 -0
  91. package/scripts/lib/worktree-issue-test.sh +15 -1
  92. package/scripts/lib/worktree-issue.sh +23 -8
  93. package/scripts/lib/worktree-start.sh +191 -7
  94. package/scripts/lib/zsh-safety-test.sh +10 -0
  95. package/scripts/portable-test.sh +13 -2
  96. package/scripts/self-install-test.sh +282 -0
  97. package/scripts/setup-labels.sh +1 -0
  98. package/scripts/status.sh +25 -10
  99. package/skills/kit-cleanup/SKILL.md +83 -0
  100. package/skills/kit-effort-close/SKILL.md +3 -0
  101. package/skills/kit-effort-new/SKILL.md +7 -0
  102. package/skills/kit-effort-start/SKILL.md +39 -4
  103. package/skills/kit-gc/SKILL.md +19 -0
  104. package/skills/kit-next/SKILL.md +5 -0
  105. package/skills/kit-status/SKILL.md +92 -0
  106. package/skills/kit-task-start/SKILL.md +7 -1
  107. package/templates/rules/branch-naming.md +20 -1
  108. package/templates/rules/communication-style.md +8 -0
  109. package/templates/rules/delegation-brief.md +38 -4
  110. package/templates/rules/effort-model.md +47 -4
  111. package/templates/rules/naming-and-ids.md +199 -0
  112. package/templates/rules/task-management.md +1 -1
  113. package/templates/skills/concrete/SKILL.md +117 -0
  114. package/templates/skills/karpathy-guidelines/SKILL.md +1 -0
@@ -0,0 +1,233 @@
1
+ #!/bin/sh
2
+ # kit-status-test.sh — self-test for kit-status.sh, the three-bucket "where are we?" report (#229).
3
+ # Network-free: the PR classifier is pure, so every verdict runs against fixture JSON, and the local
4
+ # bucket runs against a throwaway repo with fabricated remote refs. That matters more here than
5
+ # elsewhere — these verdicts tell a human what to do next, and a wrong one sends them to the wrong
6
+ # place. Every assertion runs under bash AND zsh.
7
+ # Run: bash scripts/lib/kit-status-test.sh
8
+ # errors: strict — a test runner: rc 1 on any failed assertion
9
+
10
+ dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
11
+
12
+ if [ -n "${KS_TEST_INNER:-}" ]; then
13
+ fail=0
14
+ eq() { if [ "$2" = "$3" ]; then :; else echo "FAIL($KS_TEST_INNER): $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
15
+ has() { case "$2" in *"$3"*) : ;; *) echo "FAIL($KS_TEST_INNER): $1 -> '$2' lacks '$3'"; fail=1 ;; esac; }
16
+ no() { case "$2" in *"$3"*) echo "FAIL($KS_TEST_INNER): $1 -> '$2' should not contain '$3'"; fail=1 ;; *) : ;; esac; }
17
+
18
+ # shellcheck source=/dev/null
19
+ . "$dir/kit-status.sh"
20
+
21
+ command -v jq >/dev/null 2>&1 || { echo " (jq absent — skipping the PR classifier)"; }
22
+
23
+ if command -v jq >/dev/null 2>&1; then
24
+ # ── status_prs_classify: one verdict per PR, most-blocking first ───────────────────────────
25
+ verdict() { printf '%s' "$2" | status_prs_classify "${3:-0}" | awk -F'\t' -v n="$1" '$2==n{print $1}'; }
26
+
27
+ fix='[
28
+ {"number":1,"title":"conflicting","draft":false,"mergeable":"CONFLICTING","checks":"PASS","approvals":2,"ai_review":true,"unresolved":0},
29
+ {"number":2,"title":"red checks","draft":false,"mergeable":"MERGEABLE","checks":"FAIL","approvals":2,"ai_review":true,"unresolved":0},
30
+ {"number":3,"title":"a draft","draft":true,"mergeable":"MERGEABLE","checks":"PASS","approvals":0,"ai_review":false,"unresolved":0},
31
+ {"number":4,"title":"still running","draft":false,"mergeable":"MERGEABLE","checks":"PENDING","approvals":0,"ai_review":true,"unresolved":0},
32
+ {"number":5,"title":"open threads","draft":false,"mergeable":"MERGEABLE","checks":"PASS","approvals":1,"ai_review":true,"unresolved":3},
33
+ {"number":6,"title":"no ai pass","draft":false,"mergeable":"MERGEABLE","checks":"PASS","approvals":1,"ai_review":false,"unresolved":0},
34
+ {"number":7,"title":"needs a human","draft":false,"mergeable":"MERGEABLE","checks":"PASS","approvals":0,"ai_review":true,"unresolved":0},
35
+ {"number":8,"title":"good to go","draft":false,"mergeable":"MERGEABLE","checks":"PASS","approvals":1,"ai_review":true,"unresolved":0}
36
+ ]'
37
+ eq "a conflicting PR reads conflict" "$(verdict 1 "$fix" 1)" "conflict"
38
+ eq "a red check reads checks" "$(verdict 2 "$fix" 1)" "checks"
39
+ eq "a draft reads draft" "$(verdict 3 "$fix" 1)" "draft"
40
+ eq "running checks read wait" "$(verdict 4 "$fix" 1)" "wait"
41
+ eq "unresolved threads read threads" "$(verdict 5 "$fix" 1)" "threads"
42
+ eq "a missing AI pass reads ai-review" "$(verdict 6 "$fix" 1)" "ai-review"
43
+ eq "no approval reads review" "$(verdict 7 "$fix" 1)" "review"
44
+ eq "green and approved reads ready" "$(verdict 8 "$fix" 1)" "ready"
45
+
46
+ # Precedence is the whole point: a conflicting PR with red checks AND open threads must report
47
+ # the conflict, because the other two cannot be acted on until it is rebased.
48
+ prec='[{"number":9,"title":"all at once","draft":true,"mergeable":"CONFLICTING","checks":"FAIL","approvals":0,"ai_review":false,"unresolved":5}]'
49
+ eq "conflict outranks every other signal" "$(verdict 9 "$prec" 1)" "conflict"
50
+ prec2='[{"number":10,"title":"red + threads","draft":false,"mergeable":"MERGEABLE","checks":"FAIL","approvals":0,"ai_review":false,"unresolved":5}]'
51
+ eq "red checks outrank open threads" "$(verdict 10 "$prec2" 1)" "checks"
52
+ prec3='[{"number":11,"title":"threads + no approval","draft":false,"mergeable":"MERGEABLE","checks":"PASS","approvals":0,"ai_review":true,"unresolved":2}]'
53
+ eq "open threads outrank a missing approval" "$(verdict 11 "$prec3" 1)" "threads"
54
+
55
+ # With no AI reviewer in the repo, a missing AI pass must NOT be reported — otherwise every PR
56
+ # in a repo that has none reads as needing something it will never get. Same PR, both settings:
57
+ # #6 has an approval already, so it falls through to `ready`; #12 has none, so it needs a human.
58
+ eq "no AI reviewer: an approved PR is ready" "$(verdict 6 "$fix" 0)" "ready"
59
+ unapproved='[{"number":12,"title":"nobody looked","draft":false,"mergeable":"MERGEABLE","checks":"PASS","approvals":0,"ai_review":false,"unresolved":0}]'
60
+ eq "AI expected: an unreviewed PR asks for the AI pass first" \
61
+ "$(verdict 12 "$unapproved" 1)" "ai-review"
62
+ eq "no AI reviewer: the same PR asks for a human" \
63
+ "$(verdict 12 "$unapproved" 0)" "review"
64
+
65
+ # ── #240 review: mergeability UNKNOWN and pipes in titles ─────────────────────────────────
66
+ # GitHub returns UNKNOWN while it is still computing mergeability. Reading that as "not
67
+ # conflicting" would report a PR as ready that may yet conflict, so it must read as wait.
68
+ unk='[{"number":13,"title":"still computing","draft":false,"mergeable":"UNKNOWN","checks":"PASS","approvals":1,"ai_review":true,"unresolved":0}]'
69
+ eq "UNKNOWN mergeability never reads ready" "$(verdict 13 "$unk" 1)" "wait"
70
+ has "the wait reason names mergeability" \
71
+ "$(printf '%s' "$unk" | status_prs_classify 1)" "computing mergeability"
72
+ # …and a later CONFLICTING on the same PR still classifies as a conflict.
73
+ conf='[{"number":13,"title":"resolved to conflict","draft":false,"mergeable":"CONFLICTING","checks":"PASS","approvals":1,"ai_review":true,"unresolved":0}]'
74
+ eq "a resolved CONFLICTING reads conflict" "$(verdict 13 "$conf" 1)" "conflict"
75
+
76
+ # A `|` in a PR title would split the markdown table cell it is rendered into.
77
+ pipe='[{"number":14,"title":"fix: a | in the title","draft":false,"mergeable":"MERGEABLE","checks":"PASS","approvals":1,"ai_review":true,"unresolved":0}]'
78
+ has "a pipe in the title is escaped" "$(printf '%s' "$pipe" | status_prs_classify 1)" '\\|'
79
+
80
+ # The row carries the number, a trimmed title and a human reason for the verdict.
81
+ row="$(printf '%s' "$fix" | status_prs_classify 1 | awk -F'\t' '$2==5')"
82
+ has "row carries the unresolved count" "$row" "3 unresolved review thread(s)"
83
+ has "row carries the title" "$row" "open threads"
84
+ eq "an empty PR set yields no rows" "$(printf '[]' | status_prs_classify 1)" ""
85
+
86
+ # ── status_ai_expected ────────────────────────────────────────────────────────────────────
87
+ tmp="$(mktemp -d)"
88
+ mkdir -p "$tmp/none"
89
+ eq "no config and no AI review: not expected" "$(status_ai_expected "$tmp/none" '[]')" "0"
90
+ mkdir -p "$tmp/cfg"; : > "$tmp/cfg/.coderabbit.yaml"
91
+ eq "a reviewer config means expected" "$(status_ai_expected "$tmp/cfg" '[]')" "1"
92
+ eq "an AI review already present means expected" \
93
+ "$(status_ai_expected "$tmp/none" '[{"ai_review":true}]')" "1"
94
+ eq "PRs with no AI review keep it unexpected" \
95
+ "$(status_ai_expected "$tmp/none" '[{"ai_review":false}]')" "0"
96
+ else
97
+ tmp="$(mktemp -d)"
98
+ fi
99
+
100
+ # ── status_local_rows + status_worktree_rows, against a throwaway repo ───────────────────────
101
+ if command -v git >/dev/null 2>&1; then
102
+ repo="$tmp/r"; mkdir -p "$repo"
103
+ ( cd "$repo" && git init -q . && git config user.email t@t && git config user.name t \
104
+ && echo base > f.txt && git add -A && git commit -q -m init \
105
+ && git branch -M trunk \
106
+ && git update-ref refs/remotes/origin/trunk "$(git rev-parse HEAD)" ) >/dev/null 2>&1
107
+
108
+ # A branch whose commit is reachable from a remote ref is NOT undone work, even with no upstream
109
+ # configured — this is the effort-sub case that a naive `@{u}` comparison gets wrong.
110
+ ( cd "$repo" && git branch -q pushed/1-thing \
111
+ && git update-ref refs/remotes/origin/pushed/1-thing "$(git rev-parse HEAD)" ) >/dev/null 2>&1
112
+ rows="$(cd "$repo" && status_local_rows trunk)"
113
+ no "a branch already on a remote is not unpushed" "$rows" "pushed/1-thing"
114
+
115
+ # A branch with a commit on no remote at all IS undone work.
116
+ ( cd "$repo" && git checkout -q -b local/2-only && echo more >> f.txt \
117
+ && git commit -qam second && git checkout -q trunk ) >/dev/null 2>&1
118
+ rows="$(cd "$repo" && status_local_rows trunk)"
119
+ has "a commit on no remote is unpushed" "$rows" "local/2-only"
120
+ has "the row says it is on no remote" "$rows" "on no remote"
121
+ has "the row counts the commits" "$rows" "1 commit(s)"
122
+
123
+ # The base branch itself is never listed as undone work.
124
+ no "the base branch is not a row" "$rows" "$(printf 'unpushed\ttrunk')"
125
+
126
+ # A dirty worktree is a row, and its file count is real.
127
+ ( cd "$repo" && echo scratch > untracked.txt ) >/dev/null 2>&1
128
+ rows="$(cd "$repo" && status_local_rows trunk)"
129
+ has "a dirty worktree is a row" "$rows" "dirty"
130
+ has "the dirty row counts the files" "$rows" "1 uncommitted file(s)"
131
+
132
+ # A clean repo with everything pushed produces no rows at all — the bucket must be able to be
133
+ # empty, or "nothing to do" is indistinguishable from "the check is broken".
134
+ clean="$tmp/c"; mkdir -p "$clean"
135
+ ( cd "$clean" && git init -q . && git config user.email t@t && git config user.name t \
136
+ && echo a > a.txt && git add -A && git commit -q -m init && git branch -M trunk \
137
+ && git update-ref refs/remotes/origin/trunk "$(git rev-parse HEAD)" ) >/dev/null 2>&1
138
+ eq "a clean, fully pushed repo yields no rows" "$(cd "$clean" && status_local_rows trunk)" ""
139
+
140
+ # An effort sub not merged into its effort branch is called out.
141
+ eff="$tmp/e"; mkdir -p "$eff"
142
+ ( cd "$eff" && git init -q . && git config user.email t@t && git config user.name t \
143
+ && echo a > a.txt && git add -A && git commit -q -m init && git branch -M trunk \
144
+ && git update-ref refs/remotes/origin/trunk "$(git rev-parse HEAD)" \
145
+ && git checkout -q -b effort/50-thing \
146
+ && git checkout -q -b sub/51-part && echo b > b.txt && git add -A && git commit -q -m sub \
147
+ && git checkout -q trunk ) >/dev/null 2>&1
148
+ rows="$(cd "$eff" && status_local_rows trunk)"
149
+ has "an unmerged sub is reported" "$rows" "unmerged"
150
+ has "the unmerged row says it is in no effort branch" "$rows" "in no effort branch"
151
+ # …and once merged, it stops being reported.
152
+ ( cd "$eff" && git checkout -q effort/50-thing && git merge -q --no-ff -m merge sub/51-part \
153
+ && git checkout -q trunk ) >/dev/null 2>&1
154
+ rows="$(cd "$eff" && status_local_rows trunk)"
155
+ no "a merged sub is no longer reported" "$rows" "unmerged"
156
+
157
+ # A sub contained in ONE of several effort branches is not unmerged — `head -1` picked an
158
+ # arbitrary effort and reported a false positive (#240 review).
159
+ ( cd "$eff" && git checkout -q -b effort/60-other && git checkout -q trunk ) >/dev/null 2>&1
160
+ rows="$(cd "$eff" && status_local_rows trunk)"
161
+ no "a sub merged into one of several efforts is not unmerged" "$rows" "unmerged"
162
+
163
+ # status_worktree_rows lists the checkout itself, with the branch it is on.
164
+ wt="$(cd "$repo" && status_worktree_rows)"
165
+ has "the worktree inventory names the branch" "$wt" "trunk"
166
+ eq "one row per checked-out worktree" "$(printf '%s\n' "$wt" | grep -c . | tr -d ' ')" "1"
167
+
168
+ # A worktree path containing a SPACE must survive: `awk $2` truncates it at the space and the
169
+ # row then names a directory that does not exist (#240 review).
170
+ spacey="$tmp/has space"; mkdir -p "$spacey"
171
+ ( cd "$repo" && git worktree add -q "$spacey/wt" -b feat/9-spacey ) >/dev/null 2>&1
172
+ wts="$(cd "$repo" && status_worktree_rows)"
173
+ has "a worktree path with a space is intact" "$wts" "has space/wt"
174
+ ( cd "$repo" && echo dirty > "$spacey/wt/x.txt" ) >/dev/null 2>&1
175
+ rows="$(cd "$repo" && status_local_rows trunk)"
176
+ has "a dirty worktree with a space in its path is intact" "$rows" "has space/wt"
177
+
178
+ # A DETACHED worktree emits `HEAD` but no `branch`: printing on `branch` alone dropped it from
179
+ # the inventory entirely, hiding in-progress work from both output paths (#240 review).
180
+ ( cd "$repo" && git worktree add -q --detach "$tmp/det" HEAD ) >/dev/null 2>&1
181
+ wts="$(cd "$repo" && status_worktree_rows)"
182
+ has "a detached worktree is still listed" "$wts" "$tmp/det"
183
+ has "a detached worktree is labelled by HEAD" "$wts" "detached@"
184
+ has "attached worktrees keep their branch" "$wts" "feat/9-spacey"
185
+ eq "one row per worktree, detached included" \
186
+ "$(printf '%s\n' "$wts" | grep -c . | tr -d ' ')" "3"
187
+
188
+ # status_cleanup_counts must return four integers even with no classifier loaded.
189
+ counts="$(cd "$clean" && status_cleanup_counts)"
190
+ eq "cleanup counts are four fields" \
191
+ "$(printf '%s' "$counts" | awk -F'\t' '{print NF}')" "4"
192
+ case "$counts" in
193
+ *[!0-9$(printf '\t')]*) echo "FAIL($KS_TEST_INNER): cleanup counts must be integers -> '$counts'"; fail=1 ;;
194
+ *) : ;;
195
+ esac
196
+ else
197
+ echo " (git absent — skipping the local bucket)"
198
+ fi
199
+
200
+ # ── the JSON shape an agent reads ───────────────────────────────────────────────────────────
201
+ if command -v jq >/dev/null 2>&1 && command -v git >/dev/null 2>&1; then
202
+ js="$(cd "$clean" && KIT_BASE_BRANCH=trunk KIT_REPO="" status_buckets_json "$clean")"
203
+ eq "JSON is an object" "$(printf '%s' "$js" | jq -r 'type')" "object"
204
+ eq "JSON carries local_undone" "$(printf '%s' "$js" | jq -r '.local_undone | type')" "array"
205
+ eq "JSON carries worktrees" "$(printf '%s' "$js" | jq -r '.worktrees | type')" "array"
206
+ eq "JSON carries prs" "$(printf '%s' "$js" | jq -r '.prs | type')" "array"
207
+ eq "JSON carries the cleanup counts" "$(printf '%s' "$js" | jq -r '.cleanup | keys | join(",")')" \
208
+ "orphan,protected,remote_stale,safe"
209
+ eq "an empty bucket is [] not null" "$(printf '%s' "$js" | jq -r '.local_undone | length')" "0"
210
+ eq "ai_review_expected is a boolean" "$(printf '%s' "$js" | jq -r '.ai_review_expected | type')" "boolean"
211
+ # A PR bucket that could NOT be read must be distinguishable from an empty one, in the JSON and
212
+ # in the exit status — otherwise an agent treats "could not look" as "nothing to do".
213
+ eq "JSON reports whether the PRs were read" "$(printf '%s' "$js" | jq -r '.prs_read | type')" "boolean"
214
+ eq "JSON carries the dependency state" "$(printf '%s' "$js" | jq -r '.deps | keys | join(",")')" "gh,git,jq"
215
+ stub="$tmp/nogh"; mkdir -p "$stub"
216
+ for c in git jq; do p_="$(command -v $c)"; [ -n "$p_" ] && ln -sf "$p_" "$stub/$c"; done
217
+ js2="$(cd "$clean" && PATH="$stub" KIT_BASE_BRANCH=trunk KIT_REPO="o/r" status_buckets_json "$clean" 2>/dev/null)"; jrc=$?
218
+ eq "no gh: prs_read is false" "$(printf '%s' "$js2" | jq -r '.prs_read')" "false"
219
+ eq "no gh: deps.gh is false" "$(printf '%s' "$js2" | jq -r '.deps.gh')" "false"
220
+ eq "no gh: the rc is non-zero" "$([ "$jrc" -ne 0 ] && echo yes || echo no)" "yes"
221
+ fi
222
+
223
+ rm -rf "$tmp"
224
+ if [ "$fail" -eq 0 ]; then echo "PASS($KS_TEST_INNER): kit-status buckets + PR verdicts"; fi
225
+ exit "$fail"
226
+ fi
227
+
228
+ rc=0
229
+ for sh in bash zsh; do
230
+ command -v "$sh" >/dev/null 2>&1 || continue
231
+ KS_TEST_INNER="$sh" "$sh" "$0" || rc=1
232
+ done
233
+ exit "$rc"