@jeiemgi/cckit 0.10.0 → 0.12.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 (193) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/AGENTS.md +136 -127
  3. package/README.md +66 -43
  4. package/bin/cckit +151 -181
  5. package/cckit.config.json +1 -4
  6. package/package.json +1 -1
  7. package/scripts/advisor-test.sh +55 -0
  8. package/scripts/autopilot-run-test.sh +20 -12
  9. package/scripts/autopilot-run.sh +9 -1
  10. package/scripts/autopilot-test.sh +29 -13
  11. package/scripts/autopilot.sh +4 -4
  12. package/scripts/benchmark/verb-timings-test.sh +4 -0
  13. package/scripts/benchmark/verb-timings.sh +16 -5
  14. package/scripts/capture-project-ids.sh +23 -1
  15. package/scripts/check.sh +25 -0
  16. package/scripts/content-skills-test.sh +1 -1
  17. package/scripts/contribute.sh +8 -3
  18. package/scripts/copilot-loop-test.sh +66 -81
  19. package/scripts/exec-targets-test.sh +20 -0
  20. package/scripts/force-push-fence-test.sh +44 -0
  21. package/scripts/force-push-fence.baseline +1 -0
  22. package/scripts/force-push-fence.sh +51 -0
  23. package/scripts/forge-fence-test.sh +69 -0
  24. package/scripts/forge-fence.baseline +2 -0
  25. package/scripts/forge-fence.sh +76 -0
  26. package/scripts/forge-report-test.sh +100 -0
  27. package/scripts/forge-report.sh +176 -0
  28. package/scripts/init-guided-test.sh +94 -82
  29. package/scripts/init.sh +12 -7
  30. package/scripts/install-test.sh +26 -0
  31. package/scripts/install.sh +7 -0
  32. package/scripts/instruction-budget-baseline.txt +1 -1
  33. package/scripts/kit-doctor-test.sh +60 -12
  34. package/scripts/kit-doctor.sh +170 -77
  35. package/scripts/lib/agent-resolve-test.sh +2 -0
  36. package/scripts/lib/agent-resolve.sh +15 -8
  37. package/scripts/lib/board-view.sh +3 -3
  38. package/scripts/lib/captain.sh +37 -8
  39. package/scripts/lib/content-kinds-gc-test.sh +22 -21
  40. package/scripts/lib/copilot-test.sh +20 -11
  41. package/scripts/lib/copilot.sh +19 -13
  42. package/scripts/lib/effort-close-subs-test.sh +96 -0
  43. package/scripts/lib/effort-dispatch-test.sh +5 -3
  44. package/scripts/lib/effort-metrics-test.sh +7 -12
  45. package/scripts/lib/effort-metrics.sh +17 -46
  46. package/scripts/lib/effort-ops-test.sh +261 -167
  47. package/scripts/lib/effort-ops.sh +449 -171
  48. package/scripts/lib/effort-parity-test.sh +57 -62
  49. package/scripts/lib/effort-plan-test.sh +56 -54
  50. package/scripts/lib/effort-plan.sh +14 -7
  51. package/scripts/lib/effort-review-test.sh +107 -0
  52. package/scripts/lib/effort-review.sh +93 -0
  53. package/scripts/lib/effort-slug-test.sh +34 -14
  54. package/scripts/lib/effort-slug.sh +13 -13
  55. package/scripts/lib/effort.sh +58 -80
  56. package/scripts/lib/forge-github.sh +260 -0
  57. package/scripts/lib/forge-none.sh +24 -0
  58. package/scripts/lib/forge-test.sh +186 -0
  59. package/scripts/lib/forge.sh +133 -0
  60. package/scripts/lib/gh-board-add-test.sh +118 -0
  61. package/scripts/lib/gh-project-test.sh +151 -31
  62. package/scripts/lib/gh-project.sh +139 -11
  63. package/scripts/lib/gh-rest-test.sh +63 -118
  64. package/scripts/lib/gh-rest.sh +275 -52
  65. package/scripts/lib/git-core-test.sh +128 -0
  66. package/scripts/lib/grill-record-test.sh +49 -0
  67. package/scripts/lib/grill-record.sh +88 -0
  68. package/scripts/lib/handoff.sh +1 -1
  69. package/scripts/lib/init-github.sh +38 -13
  70. package/scripts/lib/kinds-test.sh +13 -16
  71. package/scripts/lib/kit-brief-test.sh +51 -10
  72. package/scripts/lib/kit-brief.sh +103 -18
  73. package/scripts/lib/kit-gc-test.sh +90 -109
  74. package/scripts/lib/kit-gc.sh +19 -22
  75. package/scripts/lib/kit-hotfix.sh +18 -16
  76. package/scripts/lib/kit-interview.sh +6 -0
  77. package/scripts/lib/kit-lib-test.sh +1 -1
  78. package/scripts/lib/kit-lib.sh +7 -7
  79. package/scripts/lib/kit-msg.sh +3 -3
  80. package/scripts/lib/kit-status.sh +19 -14
  81. package/scripts/lib/kit-task-ops-test.sh +20 -1
  82. package/scripts/lib/kit-task-ops.sh +177 -94
  83. package/scripts/lib/kto-hotfix-test.sh +53 -58
  84. package/scripts/lib/kto-task-close-test.sh +28 -27
  85. package/scripts/lib/kto-task-new-test.sh +55 -48
  86. package/scripts/lib/kto-task-pr-merge-test.sh +77 -41
  87. package/scripts/lib/kto-task-pr-test.sh +30 -34
  88. package/scripts/lib/light-task-run-test.sh +19 -15
  89. package/scripts/lib/light-task-test.sh +34 -29
  90. package/scripts/lib/light-task.sh +24 -13
  91. package/scripts/lib/loose-issues.sh +65 -0
  92. package/scripts/lib/naming-test.sh +112 -0
  93. package/scripts/lib/naming-verbs-test.sh +126 -0
  94. package/scripts/lib/naming.sh +172 -0
  95. package/scripts/lib/next-test.sh +27 -22
  96. package/scripts/lib/next.sh +13 -7
  97. package/scripts/lib/orchestration-runtime-test.sh +11 -8
  98. package/scripts/lib/plan-machine.sh +22 -16
  99. package/scripts/lib/plan-next.sh +4 -4
  100. package/scripts/lib/pr-evidence-test.sh +63 -74
  101. package/scripts/lib/pr-evidence.sh +15 -12
  102. package/scripts/lib/qa-lane-test.sh +59 -27
  103. package/scripts/lib/qa-lane.sh +14 -6
  104. package/scripts/lib/review-page-test.sh +34 -25
  105. package/scripts/lib/review-page.sh +10 -4
  106. package/scripts/lib/spec-lint-test.sh +63 -0
  107. package/scripts/lib/spec-lint.sh +95 -0
  108. package/scripts/lib/sprint-test.sh +96 -0
  109. package/scripts/lib/sprint.sh +216 -0
  110. package/scripts/lib/stage-receipt-test.sh +169 -19
  111. package/scripts/lib/stage-receipt.sh +195 -10
  112. package/scripts/lib/test-forge-shim.sh +115 -0
  113. package/scripts/lib/verbs.sh +105 -0
  114. package/scripts/lib/verbs.tsv +92 -0
  115. package/scripts/lib/version-bump-test.sh +20 -0
  116. package/scripts/lib/version-bump.sh +4 -2
  117. package/scripts/lib/worker-brief-test.sh +1 -1
  118. package/scripts/lib/worker-brief.sh +1 -1
  119. package/scripts/lib/worktree-issue-test.sh +24 -19
  120. package/scripts/lib/worktree-issue.sh +10 -10
  121. package/scripts/lib/worktree-start-test.sh +13 -16
  122. package/scripts/lib/worktree-start.sh +57 -7
  123. package/scripts/loose-issues-test.sh +102 -0
  124. package/scripts/loose-issues.baseline +5 -0
  125. package/scripts/marketing-walkthrough-test.sh +25 -30
  126. package/scripts/night-grant.sh +14 -8
  127. package/scripts/night-run.mjs +1 -1
  128. package/scripts/orchestrate-test.sh +27 -31
  129. package/scripts/orchestrate.sh +9 -3
  130. package/scripts/portable-test.sh +37 -36
  131. package/scripts/publish.sh +9 -3
  132. package/scripts/setup-labels.sh +23 -12
  133. package/scripts/setup-milestones.sh +8 -2
  134. package/scripts/status-test.sh +39 -33
  135. package/scripts/status.sh +12 -6
  136. package/scripts/task-sync-test.sh +75 -32
  137. package/scripts/task-sync.sh +97 -6
  138. package/scripts/terms-check-test.sh +191 -0
  139. package/scripts/terms-check.sh +242 -0
  140. package/scripts/verbs-gen.sh +43 -0
  141. package/scripts/verbs-help-test.sh +61 -0
  142. package/scripts/verbs-ratchet-test.sh +69 -0
  143. package/scripts/verbs-ratchet.sh +34 -0
  144. package/scripts/verbs-test.sh +120 -0
  145. package/scripts/verbs.baseline +5 -0
  146. package/skills/kit-add/SKILL.md +2 -1
  147. package/skills/kit-advisor/SKILL.md +75 -0
  148. package/skills/kit-advisor/references/close.md +53 -0
  149. package/skills/kit-advisor/references/grill.md +69 -0
  150. package/skills/kit-advisor/references/orchestrate.md +56 -0
  151. package/skills/kit-advisor/references/plan.md +64 -0
  152. package/skills/kit-advisor/references/review.md +47 -0
  153. package/skills/kit-advisor/references/step-report.md +61 -0
  154. package/skills/kit-annotate/SKILL.md +1 -0
  155. package/skills/kit-autopilot/SKILL.md +2 -1
  156. package/skills/kit-cleanup/SKILL.md +3 -2
  157. package/skills/kit-contribute/SKILL.md +1 -0
  158. package/skills/kit-customize/SKILL.md +1 -0
  159. package/skills/kit-dev/SKILL.md +1 -0
  160. package/skills/kit-digest/SKILL.md +1 -0
  161. package/skills/kit-docs-writer/SKILL.md +4 -3
  162. package/skills/kit-effort-close/SKILL.md +18 -9
  163. package/skills/kit-effort-new/SKILL.md +12 -8
  164. package/skills/kit-effort-pr/SKILL.md +8 -7
  165. package/skills/kit-effort-start/SKILL.md +1 -0
  166. package/skills/kit-gc/SKILL.md +1 -0
  167. package/skills/kit-next/SKILL.md +8 -7
  168. package/skills/kit-onboard/SKILL.md +1 -0
  169. package/skills/kit-page/SKILL.md +1 -0
  170. package/skills/kit-plan-next/SKILL.md +11 -11
  171. package/skills/kit-security-sweep/SKILL.md +1 -0
  172. package/skills/kit-ship/SKILL.md +1 -0
  173. package/skills/kit-status/SKILL.md +6 -5
  174. package/skills/kit-task-close/SKILL.md +1 -0
  175. package/skills/kit-task-new/SKILL.md +1 -0
  176. package/skills/kit-task-pr/SKILL.md +1 -0
  177. package/skills/kit-task-pr-auto/SKILL.md +2 -1
  178. package/skills/kit-task-pr-merge/SKILL.md +4 -3
  179. package/skills/kit-task-start/SKILL.md +1 -0
  180. package/skills/kit-task-sync/SKILL.md +3 -0
  181. package/skills/kit-ux-audit/SKILL.md +1 -0
  182. package/skills/routing.yaml +124 -0
  183. package/templates/hooks/kit-mail-check.sh.tmpl +1 -1
  184. package/templates/instructions.md.tmpl +3 -3
  185. package/templates/rules/authoring.md +7 -3
  186. package/templates/rules/delegation-brief.md +4 -0
  187. package/templates/rules/effort-model.md +34 -31
  188. package/templates/rules/gate-and-review.md +1 -1
  189. package/templates/rules/merge-safety.md +9 -7
  190. package/templates/rules/naming-and-ids.md +20 -24
  191. package/templates/rules/plan-next.md +5 -5
  192. package/templates/skills/campaign/SKILL.md +2 -2
  193. package/scripts/lib/engine-adapter.sh +0 -93
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
  # shellcheck shell=bash
3
- # gh-rest-test.sh — the lifecycle verbs work without GraphQL (#396). In rest mode, cckit pr, merge,
4
- # close, new, effort new, effort pr and effort close send only `gh api repos/…` calls — never
5
- # `gh api graphql`, `gh pr …` or `gh issue …` — and every board step is skipped with one notice.
6
- # The default transport is unchanged. Hermetic: a stubbed gh that answers like the REST API (it
7
- # applies --jq with the real jq), a throwaway repo and a bare remote.
3
+ # gh-rest-test.sh — the lifecycle verbs over the forge (E537.3; #396 before it). cckit pr, merge,
4
+ # close, new, effort new, effort pr and effort close send only REST requests on repos/… endpoints —
5
+ # never a gh subcommand, never GraphQL — and in a cloud session with no board named (KIT_OWNER,
6
+ # KIT_PROJECT_NUMBER) every board step is skipped with one notice. Hermetic: the shared forge shim (test-forge-shim.sh) answers like the REST API over a
7
+ # curl stand-in and logs `METHOD path {json}`; a throwaway repo and a bare remote.
8
8
  # Run: bash scripts/lib/gh-rest-test.sh
9
9
  # errors: strict — a test runner: rc 1 on any failed assertion
10
10
  set -u
@@ -24,87 +24,31 @@ export GH_TITLE="Fix the thing" GH_LABELS='[{"name":"kind:fix"},{"name":"role:te
24
24
  export GH_REPO_LABELS='[{"name":"kind:task"},{"name":"priority:p2"},{"name":"role:tech-lead"}]'
25
25
  : > "$GH_LOG"
26
26
 
27
- # rest_only <log> <label> — every gh call in <log> is `gh api` on a repos/ endpoint; none is graphql,
28
- # `gh pr …` or `gh issue …`. (The stub logs one call per line: newlines in a body become \036.)
27
+ # rest_only <log> <label> — every request in <log> is REST on a repos/ endpoint; no gh subcommand ran.
29
28
  rest_only() {
30
29
  local bad
31
- bad="$(grep -vE '^api (-[^ ]+ [^ ]+ )*repos/' "$1" | sed -n 1,3p)"
32
- if [ -n "$bad" ]; then echo "FAIL: $2 — non-REST gh calls: $bad"; fail=1; else echo "ok: $2"; fi
30
+ bad="$(grep -vE '^(GET|POST|PATCH|PUT|DELETE) repos/' "$1" | sed -n 1,3p)"
31
+ if [ -n "$bad" ]; then echo "FAIL: $2 — non-REST calls: $bad"; fail=1; else echo "ok: $2"; fi
33
32
  if grep -q graphql "$1"; then echo "FAIL: $2 — a graphql call was made"; fail=1; fi
34
33
  }
35
34
 
36
- mkdir -p "$tmp/bin"
37
- cat > "$tmp/bin/gh" <<'SH'
38
- #!/usr/bin/env bash
39
- # A REST-shaped gh: logs every call; `gh api <endpoint>` answers a fixture, through --jq when given.
40
- { printf '%s' "$*" | tr '\n' '\036'; echo; } >> "$GH_LOG"
41
- if [ "$1" != api ]; then # the default (graphql) transport's subcommands
42
- case "$1 $2" in
43
- "issue view") printf '{"state":"OPEN","title":"%s","labels":%s,"milestone":{"title":"M1"},"body":"","projectItems":[]}\n' "$GH_TITLE" "$GH_LABELS" ;;
44
- "issue create") echo "https://github.com/o/r/issues/50" ;;
45
- "pr create") echo "https://github.com/o/r/pull/7" ;;
46
- "pr view") printf '{"mergeable":"MERGEABLE","mergeStateStatus":"CLEAN","baseRefName":"%s","headRefName":"%s"}\n' "$GH_BASE" "$GH_HEAD" ;;
47
- esac
48
- exit 0
49
- fi
50
- shift; ep="$1"; shift
51
- method=""; jqx=""; fields=""; accept=""
52
- while [ $# -gt 0 ]; do
53
- case "$1" in
54
- -X|--method) method="$2"; shift 2 ;;
55
- --jq|-q) jqx="$2"; shift 2 ;;
56
- -f|-F|--raw-field|--field) fields=1; shift 2 ;;
57
- -H|--header) accept="$2"; shift 2 ;;
58
- *) shift ;;
59
- esac
60
- done
61
- [ -n "$method" ] || { [ -n "$fields" ] && method=POST || method=GET; }
62
- # GH_FAIL_EP=<glob>: that endpoint fails the way real gh does — the error JSON on stdout (--jq is
63
- # not applied), a message on stderr, rc 1.
64
- case "$ep" in ${GH_FAIL_EP:-//never//})
65
- printf '{"message":"Not Found","documentation_url":"https://docs.github.com/rest","status":"404"}'
66
- echo "gh: Not Found (HTTP 404)" >&2; exit 1 ;;
67
- esac
68
- next() { n=$(( $(cat "$GH_N" 2>/dev/null || echo 49) + 1 )); echo "$n" > "$GH_N"; echo "$n"; }
69
- state_of() { case " $GH_CLOSED " in *" $1 "*) echo closed ;; *) echo open ;; esac; }
70
- json='{}'
71
- case "$method $ep" in
72
- "GET repos/o/r/labels") json="$GH_REPO_LABELS" ;;
73
- "GET repos/o/r/milestones") json='[{"number":2,"title":"M0"},{"number":3,"title":"M1"}]' ;;
74
- "POST repos/o/r/issues") n="$(next)"; json="{\"number\":$n,\"html_url\":\"https://github.com/o/r/issues/$n\",\"user\":{\"login\":\"me\"}}" ;;
75
- "GET repos/o/r/issues") json='[{"number":99,"title":"[Effort] 99 · demo effort"},{"number":5,"title":"PR","pull_request":{}}]' ;;
76
- "GET repos/o/r/issues/"*/sub_issues) json='[{"number":101,"state":"closed"},{"number":102,"state":"closed"}]' ;;
77
- "GET repos/o/r/issues/"*/timeline)
78
- sub="${ep#repos/o/r/issues/}"; sub="${sub%/timeline}"
79
- json="[{\"event\":\"cross-referenced\",\"source\":{\"issue\":{\"number\":6$sub,\"body\":\"mentions #$sub\",\"repository_url\":\"https://api.github.com/repos/o/r\",\"pull_request\":{\"merged_at\":\"2026-01-01\"}}}},
80
- {\"event\":\"cross-referenced\",\"source\":{\"issue\":{\"number\":5$sub,\"body\":\"Closes #$sub\",\"repository_url\":\"https://api.github.com/repos/o/r\",\"pull_request\":{\"merged_at\":\"2026-01-01\"}}}}]" ;;
81
- "GET repos/o/r/issues/"*)
82
- n="${ep##*/}"
83
- json="{\"number\":$n,\"title\":\"$GH_TITLE\",\"state\":\"$(state_of "$n")\",\"body\":\"## Goal\\nship it\",\"labels\":$GH_LABELS,\"milestone\":{\"number\":3,\"title\":\"M1\"},\"user\":{\"login\":\"me\"}}" ;;
84
- "POST repos/o/r/pulls") json='{"number":7,"html_url":"https://github.com/o/r/pull/7","user":{"login":"me"}}' ;;
85
- "GET repos/o/r/pulls") json="[{\"number\":9,\"head\":{\"ref\":\"$GH_HEAD\"},\"state\":\"open\",\"merged_at\":null}]" ;;
86
- "GET repos/o/r/pulls/"*)
87
- n="${ep##*/}"
88
- case "$accept" in *diff*) printf 'diff --git a/src/app.ts b/src/app.ts\n+app\n'; exit 0 ;; esac
89
- json="{\"number\":$n,\"title\":\"feat: sub $n\",\"mergeable\":$GH_MERGEABLE,\"mergeable_state\":\"clean\",\"base\":{\"ref\":\"$GH_BASE\"},\"head\":{\"ref\":\"$GH_HEAD\"},\"body\":\"Closes #42\\nFixes #43\\nsee #44\",\"state\":\"open\",\"merged_at\":null,\"merge_commit_sha\":\"abc1234def\"}" ;;
90
- "PUT repos/o/r/pulls/"*/merge) json='{"merged":true}' ;;
91
- esac
92
- if [ -n "$jqx" ]; then printf '%s' "$json" | jq -r -c "$jqx"; else printf '%s\n' "$json"; fi
93
- SH
94
- chmod +x "$tmp/bin/gh"
35
+ # shellcheck source=/dev/null
36
+ . "$LIB/test-forge-shim.sh"; forge_shim_install "$tmp/bin"
95
37
  export PATH="$tmp/bin:$PATH" KIT_REPO="o/r" EFFORT_REPO="o/r" KIT_BASE_BRANCH="develop" KIT_WT_INSTALL=0
38
+ export GH_TOKEN=test-token CCKIT_FORGE=github
96
39
  unset KIT_CONFIG
97
40
 
98
41
  # shellcheck source=/dev/null
99
42
  . "$LIB/gh-rest.sh"
100
43
 
101
- # ── the chooser ───────────────────────────────────────────────────────────────────────────────────
102
- t "default transport is graphql" "$(cckit_gh_transport)" "graphql"
103
- t "a cloud session defaults to rest" "$(CLAUDE_CODE_REMOTE=true cckit_gh_transport)" "rest"
104
- t "CCKIT_GH_TRANSPORT=graphql wins in the cloud" "$(CLAUDE_CODE_REMOTE=true CCKIT_GH_TRANSPORT=graphql cckit_gh_transport)" "graphql"
105
- t "CCKIT_GH_TRANSPORT=rest forces rest locally" "$(CCKIT_GH_TRANSPORT=rest cckit_gh_transport)" "rest"
106
- t "an unknown value falls to the default" "$(CCKIT_GH_TRANSPORT=soap cckit_gh_transport 2>/dev/null)" "graphql"
107
- tc <(CCKIT_GH_TRANSPORT=soap cckit_gh_transport 2>&1 >/dev/null) "must be rest or graphql" "an unknown value warns"
44
+ # ── the transport ─────────────────────────────────────────────────────────────────────────────────
45
+ t "REST is the only transport" "$(cckit_gh_transport)" "rest"
46
+ cckit_gh_rest; t "cckit_gh_rest is always true" "$?" "0"
47
+ tc <(CCKIT_GH_TRANSPORT=graphql bash -c '. "$0/gh-rest.sh"; cckit_gh_rest' "$LIB" 2>&1) "CCKIT_GH_TRANSPORT is ignored" "a transport override warns that it does nothing"
48
+ t "the board runs locally" "$(cckit_board_skipped 2>/dev/null; echo $?)" "1"
49
+ t "the board is skipped in a cloud session" "$(CLAUDE_CODE_REMOTE=true cckit_board_skipped 2>/dev/null; echo $?)" "0"
50
+ t "the board is skipped with no forge" "$(unset _FORGE_LOADED; CCKIT_FORGE=none cckit_board_skipped 2>/dev/null; echo $?)" "0"
51
+ t "CCKIT_GRAPHQL=0 skips the board" "$(CCKIT_GRAPHQL=0 cckit_board_skipped 2>/dev/null; echo $?)" "0"
108
52
 
109
53
  # ── pure helpers ──────────────────────────────────────────────────────────────────────────────────
110
54
  t "closing refs are read from a PR body" \
@@ -115,9 +59,9 @@ t "closing refs are read from a PR body" \
115
59
  t "pr json carries the title" "$(gh_rest_pr_json o/r 9 | jq -r .title)" "feat: sub 9"
116
60
  t "an open PR has no merge commit" "$(gh_rest_pr_json o/r 9 | jq -r '.mergeCommit.oid // "none"')" "none"
117
61
 
118
- # ── board steps in rest mode ──────────────────────────────────────────────────────────────────────
62
+ # ── board steps in a cloud session ────────────────────────────────────────────────────────────────
119
63
  : > "$GH_LOG"
120
- out="$(CCKIT_GH_TRANSPORT=rest bash -c '
64
+ out="$(CLAUDE_CODE_REMOTE=true bash -c '
121
65
  . "$1/gh-project.sh"
122
66
  load_project_ids; echo "rc=$?"
123
67
  project_add_item NODE; echo "rc=$?"
@@ -129,7 +73,7 @@ t "every board function returns 0 in rest mode" "$(printf '%s' "$out" | grep
129
73
  t "the board functions print nothing on stdout" "$(printf '%s' "$out" | grep -vc '^rc=')" "0"
130
74
  t "the notice is printed once" "$(grep -c 'board step skipped' "$tmp/board.err")" "1"
131
75
  tc "$tmp/board.err" "^cckit: board step skipped \(GraphQL unavailable; the project's built-in workflows move the card\)$" "the notice wording"
132
- t "no gh call is made for the board" "$(wc -l < "$GH_LOG" | tr -d ' ')" "0"
76
+ t "no request is made for the board" "$(wc -l < "$GH_LOG" | tr -d ' ')" "0"
133
77
 
134
78
  # ── the task verbs ────────────────────────────────────────────────────────────────────────────────
135
79
  git init -q --bare "$tmp/remote.git"
@@ -141,7 +85,7 @@ git checkout -q -b develop; git commit -q --allow-empty -m init; git push -q ori
141
85
  . "$LIB/gh-project.sh"
142
86
  # shellcheck source=/dev/null
143
87
  . "$LIB/kit-task-ops.sh"
144
- export KIT_PROJECTS_V2=true CCKIT_GH_TRANSPORT=rest
88
+ export KIT_PROJECTS_V2=true CLAUDE_CODE_REMOTE=true
145
89
 
146
90
  # cckit pr
147
91
  git checkout -q -b fix/42-the-thing
@@ -150,24 +94,24 @@ echo x > a.txt; git add a.txt; git commit -q -m wip
150
94
  unset _CCKIT_BOARD_NOTICE_DONE; kto_task_pr 42 "Did the thing." >"$tmp/out" 2>"$tmp/err"; rc=$?
151
95
  t "pr: rc 0 over REST" "$rc" "0"
152
96
  rest_only "$GH_LOG" "pr: only REST calls"
153
- tc "$GH_LOG" '^api repos/o/r/issues/42 ' "pr: reads the issue over REST"
154
- tc "$GH_LOG" '^api repos/o/r/pulls -X POST .*-f title=fix: Fix the thing -f head=fix/42-the-thing -f base=develop' "pr: opens the PR with POST pulls"
155
- tc "$GH_LOG" '^api repos/o/r/issues/7 -X PATCH -f labels\[\]=kind:fix -f labels\[\]=role:tech-lead -f assignees\[\]=me -F milestone=3' "pr: labels, assignee and milestone in one PATCH"
97
+ tc "$GH_LOG" '^GET repos/o/r/issues/42 ' "pr: reads the issue over REST"
98
+ tc "$GH_LOG" '^POST repos/o/r/pulls \{"title":"fix: Fix the thing \[#42\]","head":"fix/42-the-thing","base":"develop"' "pr: opens the PR with POST pulls"
99
+ tc "$GH_LOG" '^PATCH repos/o/r/issues/7 \{"labels":\["kind:fix","role:tech-lead"\],"assignees":\["me"\],"milestone":3\}' "pr: labels, assignee and milestone in one PATCH"
156
100
  tc "$tmp/out" 'https://github.com/o/r/pull/7' "pr: prints the PR url"
157
101
  t "pr: the board notice is printed once" "$(grep -c 'board step skipped' "$tmp/err")" "1"
158
102
 
159
103
  : > "$GH_LOG"
160
104
  kto_task_pr 42 "Did the thing." --base main >/dev/null 2>&1; rc=$?
161
105
  t "pr --base: rc 0 over REST" "$rc" "0"
162
- tc "$GH_LOG" '^api repos/o/r/pulls -X POST .*-f head=fix/42-the-thing -f base=main' "pr --base: the explicit base is sent in POST pulls"
106
+ tc "$GH_LOG" '^POST repos/o/r/pulls \{.*"head":"fix/42-the-thing","base":"main"' "pr --base: the explicit base is sent in POST pulls"
163
107
 
164
108
  # cckit new
165
109
  : > "$GH_LOG"
166
110
  unset _CCKIT_BOARD_NOTICE_DONE; num="$(kto_task_new "Add a thing" tech-lead task p2 M1 "" "" "Body." 2>"$tmp/err" | tail -1)"; rc=$?
167
111
  t "new: rc 0 over REST" "$rc" "0"
168
112
  rest_only "$GH_LOG" "new: only REST calls"
169
- tc "$GH_LOG" '^api repos/o/r/issues -X POST -f title=Add a thing .*-f labels\[\]=kind:task -f labels\[\]=priority:p2 -f labels\[\]=role:tech-lead -F milestone=3' "new: POST issues with labels and the milestone number"
170
- tc "$GH_LOG" "^api repos/o/r/issues/$num/assignees -X POST -f assignees\[\]=me" "new: assigns the issue to its author"
113
+ tc "$GH_LOG" '^POST repos/o/r/issues \{"title":"Add a thing".*"labels":\["kind:task","priority:p2","role:tech-lead"\],"milestone":3\}' "new: POST issues with labels and the milestone number"
114
+ tc "$GH_LOG" "^POST repos/o/r/issues/$num/assignees \{\"assignees\":\[\"me\"\]\}" "new: assigns the issue to its author"
171
115
  t "new: echoes the new number" "$num" "50"
172
116
  t "new: no 'NOT added to the board' warning" "$(grep -c 'NOT added' "$tmp/err")" "0"
173
117
  t "new: the board notice is printed once" "$(grep -c 'board step skipped' "$tmp/err")" "1"
@@ -178,8 +122,8 @@ t "new: the board notice is printed once" "$(grep -c 'board step skipp
178
122
  unset _CCKIT_BOARD_NOTICE_DONE; kto_task_new "Add a thing" tech-lead feat p2 "" "" "" "Body." >"$tmp/out" 2>"$tmp/err"; rc=$?
179
123
  t "new, missing label: rc 0 over REST" "$rc" "0"
180
124
  rest_only "$GH_LOG" "new, missing label: only REST calls"
181
- tc "$GH_LOG" '^api repos/o/r/labels -X GET ' "new, missing label: reads the repo's labels over REST"
182
- tc "$GH_LOG" '^api repos/o/r/issues -X POST -f title=Add a thing .*-f labels\[\]=priority:p2 -f labels\[\]=role:tech-lead --jq' "new, missing label: POST issues with the existing labels only"
125
+ tc "$GH_LOG" '^GET repos/o/r/labels\?per_page=100' "new, missing label: reads the repo's labels over REST"
126
+ tc "$GH_LOG" '^POST repos/o/r/issues \{"title":"Add a thing".*"labels":\["priority:p2","role:tech-lead"\]' "new, missing label: POST issues with the existing labels only"
183
127
  t "new, missing label: kind:feat is not sent" "$(grep -c 'kind:feat' "$GH_LOG")" "0"
184
128
  tc "$tmp/out" '^✓ https://github.com/o/r/issues/[0-9]+$' "new, missing label: prints the issue url"
185
129
  tc "$tmp/err" "label 'kind:feat' not found" "new, missing label: the warning names kind:feat"
@@ -187,22 +131,22 @@ tc "$tmp/err" "label 'kind:feat' not found" "new, missing label: the war
187
131
  : > "$GH_LOG"
188
132
  GH_FAIL_EP="repos/o/r/labels" kto_task_new "Add a thing" tech-lead feat p2 "" "" "" "Body." >"$tmp/out" 2>"$tmp/err"; rc=$?
189
133
  t "new, unreadable label list: rc 0" "$rc" "0"
190
- tc "$GH_LOG" '^api repos/o/r/issues -X POST .*-f labels\[\]=kind:feat -f labels\[\]=priority:p2 -f labels\[\]=role:tech-lead' "new, unreadable label list: every label is sent"
134
+ tc "$GH_LOG" '^POST repos/o/r/issues \{.*"labels":\["kind:feat","priority:p2","role:tech-lead"\]' "new, unreadable label list: every label is sent"
191
135
 
192
136
  # cckit close
193
137
  : > "$GH_LOG"
194
138
  unset _CCKIT_BOARD_NOTICE_DONE; kto_task_close 5 "Shipped." >/dev/null 2>"$tmp/err"; rc=$?
195
139
  t "close: rc 0 over REST" "$rc" "0"
196
140
  rest_only "$GH_LOG" "close: only REST calls"
197
- tc "$GH_LOG" '^api repos/o/r/issues/5/comments -X POST -f body=Shipped\.$' "close: posts the summary"
198
- tc "$GH_LOG" '^api repos/o/r/issues/5 -X PATCH -f state=closed -f state_reason=completed$' "close: state_reason completed"
141
+ tc "$GH_LOG" '^POST repos/o/r/issues/5/comments \{"body":"Shipped\."\}$' "close: posts the summary"
142
+ tc "$GH_LOG" '^PATCH repos/o/r/issues/5 \{"state":"closed","state_reason":"completed"\}$' "close: state_reason completed"
199
143
  : > "$GH_LOG"
200
144
  kto_task_close 6 "Not worth it." --reason not-planned >/dev/null 2>&1
201
- tc "$GH_LOG" '^api repos/o/r/issues/6 -X PATCH -f state=closed -f state_reason=not_planned$' "close: not-planned maps to not_planned"
145
+ tc "$GH_LOG" '^PATCH repos/o/r/issues/6 \{"state":"closed","state_reason":"not_planned"\}$' "close: not-planned maps to not_planned"
202
146
  : > "$GH_LOG"
203
147
  kto_task_close 7 "Same work." --duplicate-of 4 >/dev/null 2>&1
204
- tc "$GH_LOG" '^api repos/o/r/issues/7 -X PATCH -f state=closed -f state_reason=duplicate$' "close: duplicate maps to state_reason duplicate"
205
- tc "$GH_LOG" 'issues/7/comments -X POST -f body=Same work\..*Duplicate of #4\.$' "close: the comment links the original"
148
+ tc "$GH_LOG" '^PATCH repos/o/r/issues/7 \{"state":"closed","state_reason":"duplicate"\}$' "close: duplicate maps to state_reason duplicate"
149
+ tc "$GH_LOG" '^POST repos/o/r/issues/7/comments \{"body":"Same work\..*Duplicate of #4\."\}$' "close: the comment links the original"
206
150
  : > "$GH_LOG"; GH_CLOSED="8"
207
151
  kto_task_close 8 "x" >/dev/null 2>&1; rc=$?
208
152
  t "close: an already-closed issue is fine" "$rc" "0"
@@ -219,10 +163,10 @@ git -C "$wt" push -q origin fix/9-x
219
163
  unset _CCKIT_BOARD_NOTICE_DONE; ( cd "$wt" && kto_task_pr_merge ) >"$tmp/out" 2>"$tmp/err"; rc=$?
220
164
  t "merge: rc 0 over REST" "$rc" "0"
221
165
  rest_only "$GH_LOG" "merge: only REST calls"
222
- tc "$GH_LOG" '^api repos/o/r/pulls -X GET -f head=o:fix/9-x -f state=open' "merge: finds the open PR for the branch"
223
- tc "$GH_LOG" '^api repos/o/r/pulls/9/merge -X PUT -f merge_method=squash$' "merge: squash-merges with PUT pulls/9/merge"
224
- tc "$GH_LOG" '^api repos/o/r/issues/42 -X PATCH -f state=closed -f state_reason=completed$' "merge: closes the linked open issue"
225
- t "merge: an already-closed linked issue is left" "$(grep -c 'issues/43 -X PATCH' "$GH_LOG")" "0"
166
+ tc "$GH_LOG" '^GET repos/o/r/pulls\?head=o%3Afix%2F9-x&state=open' "merge: finds the open PR for the branch"
167
+ tc "$GH_LOG" '^PUT repos/o/r/pulls/9/merge \{"merge_method":"squash"\}$' "merge: squash-merges with PUT pulls/9/merge"
168
+ tc "$GH_LOG" '^PATCH repos/o/r/issues/42 \{"state":"closed","state_reason":"completed"\}$' "merge: closes the linked open issue"
169
+ t "merge: an already-closed linked issue is left" "$(grep -c 'PATCH repos/o/r/issues/43 ' "$GH_LOG")" "0"
226
170
  t "merge: a bare mention is not a closing ref" "$(grep -c 'issues/44' "$GH_LOG")" "0"
227
171
  t "merge: the worktree is removed" "$([ -d "$wt" ] && echo present || echo gone)" "gone"
228
172
  t "merge: the local branch is deleted" "$(git branch --list fix/9-x | wc -l | tr -d ' ')" "0"
@@ -230,18 +174,15 @@ t "merge: the remote branch is kept" "$(git ls-remote --heads ori
230
174
  tc "$tmp/out" 'remote branch fix/9-x kept' "merge: says why the remote branch stays"
231
175
  : > "$GH_LOG"; GH_HEAD="fix/10-x"
232
176
  kto_task_pr_merge 10 --rebase >/dev/null 2>&1
233
- tc "$GH_LOG" '^api repos/o/r/pulls/10/merge -X PUT -f merge_method=rebase$' "merge: --rebase reaches merge_method"
177
+ tc "$GH_LOG" '^PUT repos/o/r/pulls/10/merge \{"merge_method":"rebase"\}$' "merge: --rebase reaches merge_method"
234
178
  : > "$GH_LOG"; GH_MERGEABLE="false"; GH_HEAD="fix/11-x"
235
179
  kto_task_pr_merge 11 >/dev/null 2>&1; rc=$?
236
180
  t "merge: a conflicting PR from the base is refused" "$rc" "1"
237
181
  t "merge: nothing merged on a conflict" "$(grep -c '/merge' "$GH_LOG")" "0"
238
182
  GH_MERGEABLE="true"; GH_CLOSED=""; GH_HEAD="fix/9-x"
239
183
 
240
- # ── the default transport is unchanged ────────────────────────────────────────────────────────────
241
- : > "$GH_LOG"
242
- CLAUDE_CODE_REMOTE=true CCKIT_GH_TRANSPORT=graphql KIT_PROJECTS_V2=false kto_task_close 12 "Done." >/dev/null 2>&1
243
- tc "$GH_LOG" '^issue close 12 --repo o/r --reason completed --comment Done\.$' "graphql: close still uses gh issue close"
244
- t "graphql: no REST close" "$(grep -c '^api ' "$GH_LOG")" "0"
184
+ # ── no gh subcommand, anywhere ────────────────────────────────────────────────────────────────────
185
+ t "no gh subcommand ran in the task verbs" "$(grep -c '^GH-SUBCOMMAND' "$GH_LOG")" "0"
245
186
 
246
187
  # ── the effort verbs ──────────────────────────────────────────────────────────────────────────────
247
188
  # shellcheck source=/dev/null
@@ -250,17 +191,20 @@ t "graphql: no REST close" "$(grep -c '^api ' "$GH_LOG"
250
191
  . "$LIB/effort-ops.sh"
251
192
  GH_TITLE="[Effort] 99 · demo effort"; GH_LABELS='[{"name":"role:tech-lead"},{"name":"kind:task"}]'
252
193
  export KIT_BASE_BRANCH="main"
194
+ # The parent body effort close re-reads (E546.5): a Spec, so the close goes past its check. JSON-escaped.
195
+ export GH_BODY='## Goal\nship it\n\n## Spec\n- it ships'
196
+
253
197
 
254
198
  # cckit effort new
255
199
  : > "$GH_LOG"
256
- unset _CCKIT_BOARD_NOTICE_DONE; parent="$(effort_new --flow Core "demo effort" "first sub" "second sub" 2>"$tmp/err")"; rc=$?
200
+ unset _CCKIT_BOARD_NOTICE_DONE; parent="$(effort_new --flow Core --spec "it ships" "demo effort" "first sub" "second sub" 2>"$tmp/err")"; rc=$?
257
201
  t "effort new: rc 0 over REST" "$rc" "0"
258
202
  rest_only "$GH_LOG" "effort new: only REST calls"
259
- tc "$GH_LOG" '^api repos/o/r/labels -X POST -f name=effort ' "effort new: ensures labels over REST"
260
- tc "$GH_LOG" "^api repos/o/r/issues -X POST -f title=\[Effort\] · \[Core\] demo effort .*-f labels\[\]=effort" "effort new: POST issues for the parent"
261
- tc "$GH_LOG" "^api repos/o/r/issues/$parent -X PATCH -f title=\[Effort\] $parent · \[Core\] demo effort$" "effort new: renames the parent with its number"
262
- tc "$GH_LOG" "^api repos/o/r/issues/$parent/labels -X POST -f labels\[\]=slug:demo-effort$" "effort new: adds the slug label"
263
- t "effort new: parent + 2 subs created" "$(grep -c '^api repos/o/r/issues -X POST' "$GH_LOG")" "3"
203
+ tc "$GH_LOG" '^POST repos/o/r/labels \{"name":"effort",' "effort new: ensures labels over REST"
204
+ tc "$GH_LOG" "^POST repos/o/r/issues \{\"title\":\"demo effort\".*\"labels\":\[\"effort\"" "effort new: POST issues for the parent"
205
+ tc "$GH_LOG" "^PATCH repos/o/r/issues/$parent \{\"title\":\"\[E$parent\] demo effort\"\}$" "effort new: renames the parent with its number"
206
+ tc "$GH_LOG" "^POST repos/o/r/issues/$parent/labels \{\"labels\":\[\"slug:demo-effort\"\]\}$" "effort new: adds the slug label"
207
+ t "effort new: parent + 2 subs created" "$(grep -c '^POST repos/o/r/issues ' "$GH_LOG")" "3"
264
208
  t "effort new: 2 sub-issues linked" "$(grep -c 'sub_issues' "$GH_LOG")" "2"
265
209
 
266
210
  # cckit effort pr + effort close
@@ -274,8 +218,8 @@ echo work > file.txt; git add file.txt; git commit -q -m "feat: do the thing (#1
274
218
  unset _CCKIT_BOARD_NOTICE_DONE; effort_pr 99 --summary "SUMMARY" >"$tmp/out" 2>"$tmp/err"; rc=$?
275
219
  t "effort pr: rc 0 over REST" "$rc" "0"
276
220
  rest_only "$GH_LOG" "effort pr: only REST calls"
277
- tc "$GH_LOG" '^api repos/o/r/pulls -X POST -f title=feat: demo effort \[#99\] .*-f head=effort/99-demo -f base=main' "effort pr: POST pulls effort/99 → main"
278
- tc "$GH_LOG" '^api repos/o/r/issues/7 -X PATCH -f labels\[\]=role:tech-lead -f labels\[\]=kind:task .*-F milestone=3' "effort pr: inherits labels + milestone"
221
+ tc "$GH_LOG" '^POST repos/o/r/pulls \{"title":"feat: demo effort \[E99\]","head":"effort/99-demo","base":"main"' "effort pr: POST pulls effort/99 → main"
222
+ tc "$GH_LOG" '^PATCH repos/o/r/issues/7 \{"labels":\["role:tech-lead","kind:task".*"milestone":3' "effort pr: inherits labels + milestone"
279
223
  t "effort pr: the board notice is printed once" "$(grep -c 'board step skipped' "$tmp/err")" "1"
280
224
 
281
225
  : > "$GH_LOG"; GH_HEAD="effort/99-demo"; GH_BASE="main"
@@ -283,9 +227,10 @@ unset _CCKIT_BOARD_NOTICE_DONE; close_out="$(effort_close 99 2>&1)"; rc=$?
283
227
  cd "$tmp/work" || exit 1
284
228
  t "effort close: rc 0 over REST" "$rc" "0"
285
229
  rest_only "$GH_LOG" "effort close: only REST calls"
286
- tc "$GH_LOG" '^api repos/o/r/pulls/9/merge -X PUT -f merge_method=squash$' "effort close: squash-merges over REST"
287
- tc "$GH_LOG" '^api repos/o/r/issues/101 -X PATCH -f state=closed -f state_reason=completed$' "effort close: closes sub #101"
288
- tc "$GH_LOG" '^api repos/o/r/issues/99 -X PATCH -f state=closed -f state_reason=completed$' "effort close: closes the parent"
230
+ tc "$GH_LOG" '^PUT repos/o/r/pulls/9/merge \{"merge_method":"squash"\}$' "effort close: squash-merges over REST"
231
+ # #565: the shim's subs are already closed, so close keeps their close reason (no second PATCH)
232
+ t "effort close: does not re-close an already-closed sub" "$(grep -c '^PATCH repos/o/r/issues/101 ' "$GH_LOG")" "0"
233
+ tc "$GH_LOG" '^PATCH repos/o/r/issues/99 \{"state":"closed","state_reason":"completed"\}$' "effort close: closes the parent"
289
234
  case "$close_out" in *"remote branch effort/99-demo kept"*) echo "ok: effort close: says why the remote branch stays" ;; *) echo "FAIL: effort close: no remote-branch notice: $close_out"; fail=1 ;; esac
290
235
  t "effort close: the board notice is printed once" "$(printf '%s\n' "$close_out" | grep -c 'board step skipped')" "1"
291
236
  t "effort close: the local branch is deleted" "$(git branch --list effort/99-demo | wc -l | tr -d ' ')" "0"
@@ -295,9 +240,9 @@ t "effort close: the local branch is deleted" "$(git branch --list effort/
295
240
  unset _CCKIT_BOARD_NOTICE_DONE; close_out="$(effort_close 77 2>&1)"; rc=$?
296
241
  t "wave close: rc 0 over REST" "$rc" "0"
297
242
  rest_only "$GH_LOG" "wave close: only REST calls"
298
- tc "$GH_LOG" '^api repos/o/r/issues/101/timeline ' "wave close: finds the closing PR in the sub's timeline"
299
- tc "$GH_LOG" '^api repos/o/r/pulls/5101 -H Accept: application/vnd.github.v3.diff$' "wave close: snapshots the closing PR's diff (not the mention)"
300
- tc "$GH_LOG" '^api repos/o/r/issues/77 -X PATCH -f state=closed -f state_reason=completed$' "wave close: closes the parent"
243
+ tc "$GH_LOG" '^GET repos/o/r/issues/101/timeline' "wave close: finds the closing PR in the sub's timeline"
244
+ tc "$GH_LOG" '^GET repos/o/r/pulls/5101 $' "wave close: snapshots the closing PR's diff (not the mention)"
245
+ tc "$GH_LOG" '^PATCH repos/o/r/issues/77 \{"state":"closed","state_reason":"completed"\}$' "wave close: closes the parent"
301
246
  t "wave close: rows match the graphql shape" \
302
247
  "$(gh_rest_wave_rows o/r 77 | sed -n 1p)" "101|CLOSED|5101|abc1234def|feat: sub 5101"
303
248
 
@@ -319,7 +264,7 @@ t "failed read: a sub whose timeline fails has no PR" \
319
264
  : > "$GH_LOG"
320
265
  effort_close 77 >/dev/null 2>&1; rc=$?
321
266
  t "failed read: wave close refuses" "$rc" "1"
322
- t "failed read: wave close leaves the parent open" "$(grep -c 'issues/77 -X PATCH' "$GH_LOG")" "0"
267
+ t "failed read: wave close leaves the parent open" "$(grep -c 'PATCH repos/o/r/issues/77 ' "$GH_LOG")" "0"
323
268
  export GH_FAIL_EP="repos/o/r/issues/88"
324
269
  effort_start 88 >/dev/null 2>&1
325
270
  t "failed read: effort start falls back to the effort slug" \