@jeiemgi/cckit 0.11.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.
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +45 -41
- package/README.md +39 -29
- package/bin/cckit +111 -70
- package/cckit.config.json +1 -1
- package/package.json +1 -1
- package/scripts/advisor-test.sh +55 -0
- package/scripts/autopilot.sh +4 -4
- package/scripts/capture-project-ids.sh +16 -0
- package/scripts/check.sh +6 -0
- package/scripts/content-skills-test.sh +1 -1
- package/scripts/copilot-loop-test.sh +8 -8
- package/scripts/force-push-fence-test.sh +44 -0
- package/scripts/force-push-fence.baseline +1 -0
- package/scripts/force-push-fence.sh +51 -0
- package/scripts/init.sh +2 -2
- package/scripts/instruction-budget-baseline.txt +1 -1
- package/scripts/kit-doctor-test.sh +5 -0
- package/scripts/kit-doctor.sh +96 -2
- package/scripts/lib/agent-resolve-test.sh +2 -0
- package/scripts/lib/agent-resolve.sh +3 -2
- package/scripts/lib/board-view.sh +3 -3
- package/scripts/lib/captain.sh +1 -1
- package/scripts/lib/copilot-test.sh +4 -4
- package/scripts/lib/copilot.sh +13 -13
- package/scripts/lib/effort-close-subs-test.sh +96 -0
- package/scripts/lib/effort-dispatch-test.sh +2 -2
- package/scripts/lib/effort-ops-test.sh +98 -9
- package/scripts/lib/effort-ops.sh +390 -63
- package/scripts/lib/effort-parity-test.sh +37 -31
- package/scripts/lib/effort-plan.sh +3 -3
- package/scripts/lib/effort-review-test.sh +107 -0
- package/scripts/lib/effort-review.sh +93 -0
- package/scripts/lib/effort-slug-test.sh +4 -0
- package/scripts/lib/effort-slug.sh +5 -4
- package/scripts/lib/effort.sh +47 -74
- package/scripts/lib/forge-github.sh +18 -7
- package/scripts/lib/gh-board-add-test.sh +118 -0
- package/scripts/lib/gh-project-test.sh +115 -0
- package/scripts/lib/gh-project.sh +128 -6
- package/scripts/lib/gh-rest-test.sh +12 -8
- package/scripts/lib/gh-rest.sh +189 -15
- package/scripts/lib/git-core-test.sh +2 -2
- package/scripts/lib/grill-record-test.sh +49 -0
- package/scripts/lib/grill-record.sh +88 -0
- package/scripts/lib/handoff.sh +1 -1
- package/scripts/lib/kit-brief-test.sh +29 -0
- package/scripts/lib/kit-brief.sh +91 -6
- package/scripts/lib/kit-lib-test.sh +1 -1
- package/scripts/lib/kit-lib.sh +7 -7
- package/scripts/lib/kit-msg.sh +3 -3
- package/scripts/lib/kit-status.sh +1 -1
- package/scripts/lib/kit-task-ops-test.sh +17 -0
- package/scripts/lib/kit-task-ops.sh +73 -22
- package/scripts/lib/kto-task-new-test.sh +18 -0
- package/scripts/lib/kto-task-pr-merge-test.sh +44 -0
- package/scripts/lib/kto-task-pr-test.sh +3 -3
- package/scripts/lib/light-task.sh +16 -1
- package/scripts/lib/loose-issues.sh +65 -0
- package/scripts/lib/naming-test.sh +112 -0
- package/scripts/lib/naming-verbs-test.sh +126 -0
- package/scripts/lib/naming.sh +172 -0
- package/scripts/lib/next-test.sh +1 -1
- package/scripts/lib/next.sh +6 -6
- package/scripts/lib/plan-machine.sh +9 -9
- package/scripts/lib/plan-next.sh +4 -4
- package/scripts/lib/qa-lane.sh +1 -1
- package/scripts/lib/spec-lint-test.sh +63 -0
- package/scripts/lib/spec-lint.sh +95 -0
- package/scripts/lib/sprint-test.sh +96 -0
- package/scripts/lib/sprint.sh +216 -0
- package/scripts/lib/stage-receipt-test.sh +132 -0
- package/scripts/lib/stage-receipt.sh +184 -5
- package/scripts/lib/test-forge-shim.sh +2 -1
- package/scripts/lib/verbs.sh +1 -1
- package/scripts/lib/verbs.tsv +17 -15
- package/scripts/lib/worker-brief-test.sh +1 -1
- package/scripts/lib/worker-brief.sh +1 -1
- package/scripts/lib/worktree-start.sh +42 -1
- package/scripts/loose-issues-test.sh +102 -0
- package/scripts/loose-issues.baseline +5 -0
- package/scripts/night-grant.sh +1 -1
- package/scripts/portable-test.sh +1 -1
- package/scripts/status-test.sh +1 -1
- package/scripts/status.sh +4 -4
- package/scripts/task-sync-test.sh +34 -0
- package/scripts/task-sync.sh +81 -1
- package/scripts/terms-check.sh +1 -1
- package/scripts/verbs-ratchet-test.sh +6 -1
- package/scripts/verbs-test.sh +4 -4
- package/scripts/verbs.baseline +1 -1
- package/skills/kit-add/SKILL.md +1 -1
- package/skills/kit-advisor/SKILL.md +75 -0
- package/skills/kit-advisor/references/close.md +53 -0
- package/skills/kit-advisor/references/grill.md +69 -0
- package/skills/kit-advisor/references/orchestrate.md +56 -0
- package/skills/kit-advisor/references/plan.md +64 -0
- package/skills/kit-advisor/references/review.md +47 -0
- package/skills/kit-advisor/references/step-report.md +61 -0
- package/skills/kit-autopilot/SKILL.md +1 -1
- package/skills/kit-cleanup/SKILL.md +2 -2
- package/skills/kit-effort-close/SKILL.md +16 -8
- package/skills/kit-effort-new/SKILL.md +11 -8
- package/skills/kit-effort-pr/SKILL.md +7 -7
- package/skills/kit-next/SKILL.md +7 -7
- package/skills/kit-plan-next/SKILL.md +10 -11
- package/skills/kit-status/SKILL.md +5 -5
- package/skills/kit-task-pr-auto/SKILL.md +1 -1
- package/skills/kit-task-pr-merge/SKILL.md +3 -3
- package/skills/kit-task-sync/SKILL.md +2 -0
- package/skills/routing.yaml +5 -0
- package/templates/hooks/kit-mail-check.sh.tmpl +1 -1
- package/templates/instructions.md.tmpl +3 -3
- package/templates/rules/authoring.md +7 -3
- package/templates/rules/delegation-brief.md +4 -0
- package/templates/rules/effort-model.md +34 -31
- package/templates/rules/gate-and-review.md +1 -1
- package/templates/rules/merge-safety.md +9 -7
- package/templates/rules/naming-and-ids.md +20 -24
- package/templates/rules/plan-next.md +5 -5
- package/templates/skills/campaign/SKILL.md +2 -2
package/bin/cckit
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# cckit — the CLI dispatcher. A thin bash front-end over the git-mechanics bundle (scripts/lib).
|
|
3
|
-
# Agent-agnostic: every verb runs from a shell; append --
|
|
3
|
+
# Agent-agnostic: every verb runs from a shell; append --json for machine-readable output.
|
|
4
4
|
# Driven entirely from cckit.config.json — no org/repo is hardcoded. See AGENTS.md.
|
|
5
5
|
#
|
|
6
6
|
# Every verb, its question, a prompt to paste and its usage live in ONE table: scripts/lib/verbs.tsv
|
|
@@ -51,36 +51,55 @@ source "$LIB/ui.sh"
|
|
|
51
51
|
source "$LIB/verbs.sh"
|
|
52
52
|
usage() { verbs_help; }
|
|
53
53
|
|
|
54
|
-
# --
|
|
54
|
+
# --json → structured output (parsed by agents). Strip it from positional args, export a flag.
|
|
55
|
+
# `--llm` and `--output=json` are older spellings of the same flag and keep working (#588).
|
|
55
56
|
CCKIT_OUTPUT="human"
|
|
57
|
+
_json_flag=0
|
|
56
58
|
args=()
|
|
57
59
|
for a in "$@"; do
|
|
58
60
|
case "$a" in
|
|
59
61
|
--llm|--output=json) CCKIT_OUTPUT="json" ;;
|
|
62
|
+
--json) _json_flag=1 ;;
|
|
60
63
|
*) args+=("$a") ;;
|
|
61
64
|
esac
|
|
62
65
|
done
|
|
63
66
|
set -- "${args[@]+"${args[@]}"}"
|
|
64
|
-
export CCKIT_OUTPUT
|
|
65
67
|
|
|
66
68
|
# Bare `cckit` (no verb) resumes the last session's handoff (locked behavior).
|
|
67
69
|
cmd="${1:-resume}"; shift || true
|
|
68
70
|
# The verb name, for a forge refusal that names it (scripts/lib/forge.sh forge_need).
|
|
69
71
|
export CCKIT_VERB="$cmd"
|
|
72
|
+
# The first argument as typed, before an alias adds words in front of it: `cckit sync --help` is help.
|
|
73
|
+
_first_arg="${1:-}"
|
|
70
74
|
|
|
71
75
|
# An old verb name (a `kind=alias` row of scripts/lib/verbs.tsv) still works (#557): it prints a
|
|
72
|
-
# one-line notice on stderr and runs the verb it was renamed to.
|
|
73
|
-
#
|
|
76
|
+
# one-line notice on stderr and runs the verb it was renamed to. A target may carry words after the
|
|
77
|
+
# verb (`status --board`, `agent lib`, #588); they go in front of the typed arguments. CCKIT_VERB
|
|
78
|
+
# keeps the typed name, so a refusal names what the user ran. Aliases are never removed before 1.0.
|
|
74
79
|
if _alias_target="$(verbs_alias_target "$cmd")"; then
|
|
75
80
|
verbs_alias_notice "$cmd" "$_alias_target" >&2
|
|
76
|
-
|
|
81
|
+
# shellcheck disable=SC2086 # the target's words split on purpose: "status --board" → status, --board
|
|
82
|
+
set -- $_alias_target "$@"
|
|
83
|
+
cmd="$1"; shift
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# `--json` is the documented output flag. Three verbs own a `--json` of their own, with another
|
|
87
|
+
# shape, and receive it untouched: `commands --json` (the full catalog), `status --board --json`
|
|
88
|
+
# (the board as one document) and `bench … --json`. Everywhere else it means CCKIT_OUTPUT=json.
|
|
89
|
+
if [ "$_json_flag" = 1 ]; then
|
|
90
|
+
case "$cmd" in
|
|
91
|
+
commands|bench) set -- "$@" --json ;;
|
|
92
|
+
status) case " $* " in *" --board "*) set -- "$@" --json ;; *) CCKIT_OUTPUT="json" ;; esac ;;
|
|
93
|
+
*) CCKIT_OUTPUT="json" ;;
|
|
94
|
+
esac
|
|
77
95
|
fi
|
|
96
|
+
export CCKIT_OUTPUT
|
|
78
97
|
|
|
79
98
|
# `cckit <verb> --help` (#556): the dispatcher answers from the verb table before the verb runs, so
|
|
80
99
|
# every verb has help and none sees a --help it does not parse. A verb whose table row says
|
|
81
100
|
# ownhelp=yes then runs with that --help too, in a child, and its own text follows under "Details:".
|
|
82
101
|
# Help always exits 0: some verbs print their usage on --help with rc 2.
|
|
83
|
-
case "$
|
|
102
|
+
case "$_first_arg" in
|
|
84
103
|
-h|--help)
|
|
85
104
|
if [ -z "${_CCKIT_HELP_SHOWN:-}" ] && verbs_entry "$cmd"; then
|
|
86
105
|
[ "$(verbs_get "$cmd" 7)" = yes ] || exit 0
|
|
@@ -121,6 +140,13 @@ case "$cmd" in
|
|
|
121
140
|
source "$LIB/role-identity.sh" 2>/dev/null || true
|
|
122
141
|
fi
|
|
123
142
|
effort_new "$@" ;;
|
|
143
|
+
sub)
|
|
144
|
+
if [ "${KIT_PROJECTS_V2:-}" = "true" ]; then
|
|
145
|
+
# shellcheck source=/dev/null
|
|
146
|
+
source "$LIB/gh-project.sh"; load_project_ids >/dev/null 2>&1 || true
|
|
147
|
+
fi
|
|
148
|
+
effort_sub "$@" ;;
|
|
149
|
+
retitle) effort_retitle "$@" ;;
|
|
124
150
|
chain) effort_chain "$@" ;;
|
|
125
151
|
start) effort_start "$@" ;;
|
|
126
152
|
pr)
|
|
@@ -130,8 +156,35 @@ case "$cmd" in
|
|
|
130
156
|
source "$LIB/role-identity.sh" 2>/dev/null || true
|
|
131
157
|
effort_pr "$@" ;;
|
|
132
158
|
close) effort_close "$@" ;;
|
|
133
|
-
plan)
|
|
134
|
-
|
|
159
|
+
plan)
|
|
160
|
+
# One planning verb (#585). Bare: the session-fit view of the open efforts. `--issues`: the
|
|
161
|
+
# open issues in dependency waves (was `cckit plan`). `--wave`: the next wave as a fan-out
|
|
162
|
+
# brief plus the captain drive (was `cckit wave` / `copilot`). `--next`: what to build next,
|
|
163
|
+
# from what the kit already does (was `cckit plan-next`). The old names are alias rows.
|
|
164
|
+
case "${1:-}" in
|
|
165
|
+
--issues) shift
|
|
166
|
+
# shellcheck source=/dev/null
|
|
167
|
+
source "$LIB/plan-machine.sh"; plan_machine "$@" ;;
|
|
168
|
+
--wave) shift
|
|
169
|
+
# shellcheck source=/dev/null
|
|
170
|
+
source "$LIB/copilot.sh"; copilot_brief "$@" ;;
|
|
171
|
+
--next) shift
|
|
172
|
+
# shellcheck source=/dev/null
|
|
173
|
+
source "$LIB/plan-next.sh"; plan_next "$@" ;;
|
|
174
|
+
*)
|
|
175
|
+
# shellcheck source=/dev/null
|
|
176
|
+
source "$LIB/effort-plan.sh"; effort_plan "$@" ;;
|
|
177
|
+
esac ;;
|
|
178
|
+
sprint)
|
|
179
|
+
# One week, Monday to Monday, as a forge milestone (#570). A sub-verb, so the top-level verb
|
|
180
|
+
# count does not grow; `name` and `bounds` run on git alone.
|
|
181
|
+
# shellcheck source=/dev/null
|
|
182
|
+
source "$LIB/sprint.sh"; sprint_cli "$@" ;;
|
|
183
|
+
review)
|
|
184
|
+
# Each sub against its own `## Spec`, one verdict line per sub (#583). A read.
|
|
185
|
+
# shellcheck source=/dev/null
|
|
186
|
+
source "$LIB/effort-review.sh"; effort_review "$@" ;;
|
|
187
|
+
*) echo "cckit effort <new|sub|retitle|chain|start|pr|close|plan|sprint|review>" >&2; exit 2 ;;
|
|
135
188
|
esac
|
|
136
189
|
;;
|
|
137
190
|
start)
|
|
@@ -262,25 +315,6 @@ case "$cmd" in
|
|
|
262
315
|
case "${1:-}" in -h|--help) echo 'cckit merge [<pr>] [--squash|--merge|--rebase] merge (squash by default; rebases on conflict), close linked issues, GC branch + worktree, update the PR base'; exit 0 ;; esac
|
|
263
316
|
kto_task_pr_merge "$@"
|
|
264
317
|
;;
|
|
265
|
-
sync) exec "$ROOT/scripts/task-sync.sh" "$@" ;;
|
|
266
|
-
plan)
|
|
267
|
-
# Wave plan over the board (deps-ordered, file-disjoint, session-fit). Runs in the invoking
|
|
268
|
-
# project; needs config so KIT_REPO is set before plan-machine reads it.
|
|
269
|
-
# shellcheck source=/dev/null
|
|
270
|
-
source "$LIB/kit-config.sh" && load_kit_config
|
|
271
|
-
# shellcheck source=/dev/null
|
|
272
|
-
source "$LIB/plan-machine.sh"; plan_machine "$@"
|
|
273
|
-
;;
|
|
274
|
-
plan-next)
|
|
275
|
-
# Forward planner: introspect the CURRENT capability surface (skills/verbs/rules/docs) and
|
|
276
|
-
# propose what to build next, grounded in what the kit can already do. Filesystem-only — config
|
|
277
|
-
# is loaded for the project-root inference (KIT_CONFIG), then plan-next scans that root. Output
|
|
278
|
-
# is HUMAN / orchestrator-facing only — never wired into a monitored model's context (#86).
|
|
279
|
-
# shellcheck source=/dev/null
|
|
280
|
-
source "$LIB/kit-config.sh" && load_kit_config 2>/dev/null || true
|
|
281
|
-
# shellcheck source=/dev/null
|
|
282
|
-
source "$LIB/plan-next.sh"; plan_next "$@"
|
|
283
|
-
;;
|
|
284
318
|
cleanup)
|
|
285
319
|
# ONE guided destructive sweep over the gc analysis: plan first, delete only the SAFE rows, and
|
|
286
320
|
# only with --yes. Orphans, protected branches and stashes are surfaced and left alone.
|
|
@@ -363,15 +397,6 @@ case "$cmd" in
|
|
|
363
397
|
# shellcheck source=/dev/null
|
|
364
398
|
source "$LIB/next.sh"; next_issue "$@"
|
|
365
399
|
;;
|
|
366
|
-
wave)
|
|
367
|
-
# Read the open efforts and propose the incoming waves of work: emit the wave-0 Task-subagent
|
|
368
|
-
# fan-out + the between-waves captain drive. (`copilot`, its old name, reaches here through the alias path above.)
|
|
369
|
-
# Runs in the invoking project; needs config so KIT_REPO is set before it reads it.
|
|
370
|
-
# shellcheck source=/dev/null
|
|
371
|
-
source "$LIB/kit-config.sh" && load_kit_config
|
|
372
|
-
# shellcheck source=/dev/null
|
|
373
|
-
source "$LIB/copilot.sh"; copilot_brief "$@"
|
|
374
|
-
;;
|
|
375
400
|
watch)
|
|
376
401
|
# Captain: gate open PRs, squash-merge the CLEAN ones, advance to the next wave. Runs in the
|
|
377
402
|
# invoking project; needs config so KIT_REPO is set before captain reads it.
|
|
@@ -438,8 +463,6 @@ cckit bench verbs [--runs N] [--checkout <dir>] [--verb "<verb>"] [--json] (at
|
|
|
438
463
|
esac
|
|
439
464
|
;;
|
|
440
465
|
scan) source "$LIB/project-scan.sh"; project_scan "$@" ;;
|
|
441
|
-
encode-context) source "$LIB/toon.sh"; toon_encode ;;
|
|
442
|
-
render) source "$LIB/render.sh"; cckit_render ;;
|
|
443
466
|
debug) exec "$ROOT/scripts/debug.sh" "$@" ;;
|
|
444
467
|
contribute)
|
|
445
468
|
# The cckit checkout containing cwd (a worktree, per the rules) wins over the installed one, so
|
|
@@ -449,7 +472,15 @@ cckit bench verbs [--runs N] [--checkout <dir>] [--verb "<verb>"] [--json] (at
|
|
|
449
472
|
croot="$(contribute_root "$PWD" "$ROOT")"
|
|
450
473
|
[ "$croot" = "$ROOT" ] || echo "contribute: using the checkout at $croot" >&2
|
|
451
474
|
cd "$croot"; exec "$croot/scripts/contribute.sh" "$@" ;;
|
|
452
|
-
status)
|
|
475
|
+
status)
|
|
476
|
+
# `--board` is the board view by role, what `cckit sync` printed before it folded in here (#588);
|
|
477
|
+
# every other form is the "where are we?" dashboard.
|
|
478
|
+
case " $* " in
|
|
479
|
+
*" --board "*)
|
|
480
|
+
board_args=(); for a in "$@"; do [ "$a" = --board ] || board_args+=("$a"); done
|
|
481
|
+
exec "$ROOT/scripts/task-sync.sh" "${board_args[@]+"${board_args[@]}"}" ;;
|
|
482
|
+
esac
|
|
483
|
+
exec "$ROOT/scripts/status.sh" "$@" ;;
|
|
453
484
|
claims)
|
|
454
485
|
# Live session claims (#384) — which session is working which issue. Read-only: a dead claim is
|
|
455
486
|
# skipped here and reaped by the next `cckit start` on that issue, never by this verb.
|
|
@@ -466,18 +497,6 @@ cckit bench verbs [--runs N] [--checkout <dir>] [--verb "<verb>"] [--json] (at
|
|
|
466
497
|
;;
|
|
467
498
|
resume) source "$LIB/handoff.sh"; handoff_read ;;
|
|
468
499
|
handoff) source "$LIB/handoff.sh"; handoff_write "$@" ;;
|
|
469
|
-
msg)
|
|
470
|
-
# Session mail (#175) — pure git-local state (.cckit/mail at the root worktree), no config.
|
|
471
|
-
source "$LIB/kit-msg.sh"
|
|
472
|
-
sub="${1:-}"; shift || true
|
|
473
|
-
case "$sub" in
|
|
474
|
-
send) msg_send "$@" ;;
|
|
475
|
-
read) msg_read "$@" ;;
|
|
476
|
-
list) msg_list ;;
|
|
477
|
-
hook-check) msg_hook_check "$@" ;;
|
|
478
|
-
*) echo 'cckit msg <send|read|list|hook-check>' >&2; exit 2 ;;
|
|
479
|
-
esac
|
|
480
|
-
;;
|
|
481
500
|
install) exec "$ROOT/scripts/install.sh" "$@" ;;
|
|
482
501
|
init)
|
|
483
502
|
# init resolves the config from the folder it sets up. The KIT_CONFIG this dispatcher worked out
|
|
@@ -494,16 +513,6 @@ cckit bench verbs [--runs N] [--checkout <dir>] [--verb "<verb>"] [--json] (at
|
|
|
494
513
|
verbs="$(verbs_names | sort -u)"
|
|
495
514
|
if cckit_is_json; then printf '%s\n' "$verbs" | jq -R . | jq -cs .; else printf '%s\n' "$verbs" | tr '\n' ' '; echo; fi
|
|
496
515
|
;;
|
|
497
|
-
lib)
|
|
498
|
-
# The HELPER catalog — the companion to `commands` (#222). `commands` lists the verbs; this
|
|
499
|
-
# lists the library they are built from, so a helper like pr-evidence.sh is discoverable
|
|
500
|
-
# without an `ls`. Filesystem-only; config is loaded purely for the project-root inference
|
|
501
|
-
# (KIT_CONFIG), then it catalogs that project's scripts/lib, else cckit's own.
|
|
502
|
-
# shellcheck source=/dev/null
|
|
503
|
-
source "$LIB/kit-config.sh" && load_kit_config 2>/dev/null || true
|
|
504
|
-
# shellcheck source=/dev/null
|
|
505
|
-
source "$LIB/kit-lib.sh"; kit_lib "$@"
|
|
506
|
-
;;
|
|
507
516
|
brief)
|
|
508
517
|
# The delegation BRIEF for an issue, generated from real state (#221). The companion to `lib`:
|
|
509
518
|
# `lib` says what helpers exist, this says which of them THIS issue's files sit on, where the
|
|
@@ -520,14 +529,46 @@ cckit bench verbs [--runs N] [--checkout <dir>] [--verb "<verb>"] [--json] (at
|
|
|
520
529
|
CCKIT_ROOT="$ROOT" kit_brief "$@"
|
|
521
530
|
;;
|
|
522
531
|
|
|
523
|
-
|
|
524
|
-
#
|
|
525
|
-
#
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
532
|
+
agent)
|
|
533
|
+
# The plumbing agents call and people rarely type (#588): each was a top-level verb and keeps
|
|
534
|
+
# its old name as an alias row of scripts/lib/verbs.tsv.
|
|
535
|
+
sub="${1:-}"; shift || true
|
|
536
|
+
case "$sub" in
|
|
537
|
+
lib)
|
|
538
|
+
# The HELPER catalog — the companion to `commands` (#222). `commands` lists the verbs; this
|
|
539
|
+
# lists the library they are built from, so a helper like pr-evidence.sh is discoverable
|
|
540
|
+
# without an `ls`. Filesystem-only; config is loaded purely for the project-root inference
|
|
541
|
+
# (KIT_CONFIG), then it catalogs that project's scripts/lib, else cckit's own.
|
|
542
|
+
# shellcheck source=/dev/null
|
|
543
|
+
source "$LIB/kit-config.sh" && load_kit_config 2>/dev/null || true
|
|
544
|
+
# shellcheck source=/dev/null
|
|
545
|
+
source "$LIB/kit-lib.sh"; kit_lib "$@"
|
|
546
|
+
;;
|
|
547
|
+
receipt)
|
|
548
|
+
# One durable record per stage attempt (#322). The WORKER calls this itself: cckit never
|
|
549
|
+
# reads pane output, because #326 requires that pane history — off by default, and able to
|
|
550
|
+
# hold secrets — is never a dependency. The report arrives on stdin in the shape `cckit
|
|
551
|
+
# brief`'s receipt contract asked for, so the prompt and this parser cannot drift apart.
|
|
552
|
+
# shellcheck source=/dev/null
|
|
553
|
+
source "$LIB/stage-receipt.sh"
|
|
554
|
+
sr_cli "$@"
|
|
555
|
+
;;
|
|
556
|
+
msg)
|
|
557
|
+
# Session mail (#175) — pure git-local state (.cckit/mail at the root worktree), no config.
|
|
558
|
+
source "$LIB/kit-msg.sh"
|
|
559
|
+
msub="${1:-}"; shift || true
|
|
560
|
+
case "$msub" in
|
|
561
|
+
send) msg_send "$@" ;;
|
|
562
|
+
read) msg_read "$@" ;;
|
|
563
|
+
list) msg_list ;;
|
|
564
|
+
hook-check) msg_hook_check "$@" ;;
|
|
565
|
+
*) echo 'cckit agent msg <send|read|list|hook-check>' >&2; exit 2 ;;
|
|
566
|
+
esac
|
|
567
|
+
;;
|
|
568
|
+
encode-context) source "$LIB/toon.sh"; toon_encode ;;
|
|
569
|
+
render) source "$LIB/render.sh"; cckit_render ;;
|
|
570
|
+
*) echo 'cckit agent <lib|receipt|msg|encode-context|render>' >&2; exit 2 ;;
|
|
571
|
+
esac
|
|
531
572
|
;;
|
|
532
573
|
qa)
|
|
533
574
|
# The QA lane (#295): launch the stack command the project declared under `qa`, on this lane's
|
package/cckit.config.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# shellcheck shell=bash
|
|
3
|
+
# advisor-test.sh — the kit-advisor skill (E547): the router stays short, every stage reference
|
|
4
|
+
# ends with the step report in its one order plus the trail command, and every `cckit` verb the
|
|
5
|
+
# skill names is one the kit has. Text checks only; no forge, no network.
|
|
6
|
+
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
7
|
+
set -u
|
|
8
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
9
|
+
SK="$ROOT/skills/kit-advisor"
|
|
10
|
+
fail=0
|
|
11
|
+
ok() { echo "ok: $1"; }
|
|
12
|
+
bad() { echo "FAIL: $1"; fail=1; }
|
|
13
|
+
# shellcheck source=/dev/null
|
|
14
|
+
. "$ROOT/scripts/lib/kit-brief.sh"
|
|
15
|
+
|
|
16
|
+
ORDER='Status · Done · Waiting for a yes · Numbers · Failing or risky · Open questions · Next step'
|
|
17
|
+
# flat <file> — the file on one line, whitespace and markdown emphasis collapsed, so a sentence the
|
|
18
|
+
# editor wrapped still matches.
|
|
19
|
+
flat() { tr '\n' ' ' < "$1" | sed 's/\*\*//g; s/[[:space:]][[:space:]]*/ /g'; }
|
|
20
|
+
|
|
21
|
+
[ -f "$SK/SKILL.md" ] || { echo "FAIL: no skills/kit-advisor/SKILL.md"; exit 1; }
|
|
22
|
+
lines="$(wc -l < "$SK/SKILL.md" | tr -d ' ')"
|
|
23
|
+
if [ "$lines" -le 80 ]; then ok "SKILL.md is a router ($lines lines, at most 80)"; else bad "SKILL.md has $lines lines (at most 80)"; fi
|
|
24
|
+
case "$(flat "$SK/SKILL.md")" in *"$ORDER"*) ok "SKILL.md states the report order" ;; *) bad "SKILL.md lacks the report order" ;; esac
|
|
25
|
+
|
|
26
|
+
for stage in grill plan orchestrate review close; do
|
|
27
|
+
f="$SK/references/$stage.md"
|
|
28
|
+
[ -f "$f" ] || { bad "no references/$stage.md"; continue; }
|
|
29
|
+
grep -q "references/$stage.md" "$SK/SKILL.md" && ok "SKILL.md routes to $stage" || bad "SKILL.md does not route to $stage"
|
|
30
|
+
body="$(flat "$f")"
|
|
31
|
+
case "$body" in *"$ORDER"*) ok "$stage states the report order" ;; *) bad "$stage lacks the report order" ;; esac
|
|
32
|
+
case "$body" in *'cckit agent receipt <'*'--report .cckit/reports/'*) ok "$stage states the trail command" ;; *) bad "$stage lacks the trail command" ;; esac
|
|
33
|
+
case "$body" in *'references/step-report.md'*) ok "$stage points to the template" ;; *) bad "$stage does not point to step-report.md" ;; esac
|
|
34
|
+
done
|
|
35
|
+
case "$(flat "$SK/references/step-report.md")" in *"$ORDER"*) ok "the template states the order" ;; *) bad "the template lacks the order" ;; esac
|
|
36
|
+
|
|
37
|
+
# The template's seven headings, in order.
|
|
38
|
+
got="$(grep '^## ' "$SK/references/step-report.md" | sed -n '/^## Status$/,/^## Next step$/p' | sed 's/^## //' | paste -sd'|' -)"
|
|
39
|
+
want="$(printf '%s' "$ORDER" | sed 's/ · /|/g')"
|
|
40
|
+
[ "$got" = "$want" ] && ok "the template's headings follow the order" || bad "template headings '$got' != '$want'"
|
|
41
|
+
|
|
42
|
+
# Every `cckit <verb> [<sub>]` the skill names in code (a code line or a backtick span) resolves (an `effort` sub-verb against the dispatcher).
|
|
43
|
+
verbs="$(cat "$SK/SKILL.md" "$SK"/references/*.md | grep -oE '(^|`)cckit [a-z][a-z-]*( [a-z][a-z-]*)?' | sed 's/^`//; s/^cckit //' | sort -u)"
|
|
44
|
+
n=0
|
|
45
|
+
while IFS= read -r v; do
|
|
46
|
+
[ -n "$v" ] || continue
|
|
47
|
+
n=$((n + 1))
|
|
48
|
+
kit_brief_verb_ok "$v" || bad "the skill names an unknown verb: cckit $v"
|
|
49
|
+
done <<EOF_V
|
|
50
|
+
$verbs
|
|
51
|
+
EOF_V
|
|
52
|
+
[ "$n" -gt 5 ] && ok "every one of the $n verbs the skill names resolves" || bad "found only $n verbs in the skill"
|
|
53
|
+
|
|
54
|
+
[ "$fail" -eq 0 ] && echo "ALL OK (advisor)"
|
|
55
|
+
exit "$fail"
|
package/scripts/autopilot.sh
CHANGED
|
@@ -41,9 +41,9 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
41
41
|
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
42
42
|
|
|
43
43
|
# No explicit issues -> auto-select from the board: open issues, minus effort PARENTS (the
|
|
44
|
-
# "[
|
|
45
|
-
# title convention) and minus anything blocked_by an open issue. orchestrate
|
|
46
|
-
# blocked_by gate at launch; this is the coarse pre-filter so the board drives the wave.
|
|
44
|
+
# "[E<n>] ..." umbrella issues, legacy "[Effort] N ...", that decompose into subs, identified by
|
|
45
|
+
# label:effort OR the title convention) and minus anything blocked_by an open issue. orchestrate
|
|
46
|
+
# re-checks the blocked_by gate at launch; this is the coarse pre-filter so the board drives the wave.
|
|
47
47
|
if [ "${#ISSUES[@]}" -eq 0 ]; then
|
|
48
48
|
echo "autopilot: no issues passed - auto-selecting unblocked open issues from the board"
|
|
49
49
|
board="$(bash "$ROOT/scripts/task-sync.sh" --raw-json)" || {
|
|
@@ -53,7 +53,7 @@ if [ "${#ISSUES[@]}" -eq 0 ]; then
|
|
|
53
53
|
selected="$(printf '%s' "$board" | jq -r '
|
|
54
54
|
if type != "array" then error("expected an issue array") else . end
|
|
55
55
|
| .[]
|
|
56
|
-
| select((any(.labels[]; .name == "effort")) or (.title | test("^\\[Effort\\] ")) | not)
|
|
56
|
+
| select((any(.labels[]; .name == "effort")) or (.title | test("^\\[Effort\\] |^\\[E[0-9]+\\] ")) | not)
|
|
57
57
|
| .number')" || { echo "autopilot: invalid board data" >&2; exit 1; }
|
|
58
58
|
while IFS= read -r n; do
|
|
59
59
|
[ -n "$n" ] && ISSUES+=("$n")
|
|
@@ -26,6 +26,22 @@ case "${KIT_PROJECT_OWNER_TYPE:-user}" in
|
|
|
26
26
|
*) OWNER_ROOT="user" ;;
|
|
27
27
|
esac
|
|
28
28
|
|
|
29
|
+
# REST first (E546.7): the Projects v2 REST endpoints give the same ids (node ids for PROJECT_ID and
|
|
30
|
+
# <FIELD>_FIELD_ID, plus <FIELD>_FIELD_NUM, the REST field id, and <FIELD>_ITER_<TITLE> for
|
|
31
|
+
# iteration fields). GraphQL below runs only when REST cannot serve the read.
|
|
32
|
+
if REST_BASE="$(gh_rest_board_base "$OWNER_ROOT" "$KIT_OWNER" "$KIT_PROJECT_NUMBER")" \
|
|
33
|
+
&& REST_LINES="$(gh_rest_board_ids_env "$REST_BASE")" && [[ "$REST_LINES" == PROJECT_ID=?* ]]; then
|
|
34
|
+
{
|
|
35
|
+
echo "# Generated by capture-project-ids.sh (REST) — do not edit by hand."
|
|
36
|
+
printf '%s\n' "$REST_LINES"
|
|
37
|
+
} > "$OUT"
|
|
38
|
+
echo "✓ Wrote $OUT (REST)"
|
|
39
|
+
echo " Fields captured:"
|
|
40
|
+
grep -E '_FIELD_ID=' "$OUT" | sed 's/^/ /'
|
|
41
|
+
exit 0
|
|
42
|
+
fi
|
|
43
|
+
echo "cckit: capture-project-ids: REST could not read the board, falling back to GraphQL" >&2
|
|
44
|
+
|
|
29
45
|
# Build the query with the resolved root; the response is read under the SAME root below so the
|
|
30
46
|
# selector and the jq path stay in lockstep regardless of user- vs org-owned board.
|
|
31
47
|
DATA=$(forge_rest graphql -f query="
|
package/scripts/check.sh
CHANGED
|
@@ -48,6 +48,12 @@ leak_fence_check || fail=1
|
|
|
48
48
|
note "==> forge fence"
|
|
49
49
|
bash scripts/forge-fence.sh || fail=1
|
|
50
50
|
|
|
51
|
+
# 3c. The force-push fence (#592). A pushed branch is brought onto its base by merge, never by a
|
|
52
|
+
# rebase, so no non-test line under bin/ or scripts/ pushes with --force, -f or --force-with-lease.
|
|
53
|
+
# Ratchet in scripts/force-push-fence.baseline (0).
|
|
54
|
+
note "==> force-push fence"
|
|
55
|
+
bash scripts/force-push-fence.sh || fail=1
|
|
56
|
+
|
|
51
57
|
note "==> secret + privacy guard"
|
|
52
58
|
if [ -f scripts/lib/secret-guard.sh ]; then
|
|
53
59
|
. scripts/lib/secret-guard.sh
|
|
@@ -96,7 +96,7 @@ t "campaign: no task finish line without --all" "$(grep -c 'cckit task finish' "
|
|
|
96
96
|
has "cckit task has the default verb" "$help" "cckit task default"
|
|
97
97
|
# The effort lane's flags are ones `effort new` parses.
|
|
98
98
|
eo="$(cat "$ROOT/scripts/lib/effort-ops.sh")"
|
|
99
|
-
for fl in --kind --goal --scope --verification; do
|
|
99
|
+
for fl in --kind --goal --spec --scope --verification; do
|
|
100
100
|
has "effort new parses $fl" "$eo" " $fl)"
|
|
101
101
|
done
|
|
102
102
|
# ── page-design names its three skills and never claims a missing one (#504) ────────────────────
|
|
@@ -98,7 +98,7 @@ export CAPTAIN_STATE="$TMP/captain.state"
|
|
|
98
98
|
cckit() { ( cd "$TMP/repo" && bash "$ROOT/bin/cckit" "$@" ); }
|
|
99
99
|
|
|
100
100
|
echo "== wave: plan layers the dependent into wave 1 =="
|
|
101
|
-
PLAN="$(CCKIT_OUTPUT=human cckit plan --cap 8 2>&1)"
|
|
101
|
+
PLAN="$(CCKIT_OUTPUT=human cckit effort plan --issues --cap 8 2>&1)"
|
|
102
102
|
# wave 0 holds the two roots; #102 (blocked by #101) must be in wave 1.
|
|
103
103
|
# anchor on the row's first column (| #N |) so an "after #N" cell never false-matches.
|
|
104
104
|
w101="$(printf '%s' "$PLAN" | awk '/^## Wave/{w=$3} /^\| #101 \|/{print w}')"
|
|
@@ -109,9 +109,9 @@ ok "$w103" "0" "plan: #103 root in wave 0"
|
|
|
109
109
|
ok "$w102" "1" "plan: #102 dependent in wave 1"
|
|
110
110
|
|
|
111
111
|
echo "== wave brief: one set of wave data, dispatch wording per adapter (E257.6) =="
|
|
112
|
-
W_CL="$(CCKIT_OUTPUT=human cckit wave --adapter claude 2>&1)"
|
|
113
|
-
W_CX="$(CCKIT_OUTPUT=human cckit wave --adapter codex 2>&1)"
|
|
114
|
-
W_BOTH="$(CCKIT_OUTPUT=human cckit wave --adapter both 2>&1)"
|
|
112
|
+
W_CL="$(CCKIT_OUTPUT=human cckit effort plan --wave --adapter claude 2>&1)"
|
|
113
|
+
W_CX="$(CCKIT_OUTPUT=human cckit effort plan --wave --adapter codex 2>&1)"
|
|
114
|
+
W_BOTH="$(CCKIT_OUTPUT=human cckit effort plan --wave --adapter both 2>&1)"
|
|
115
115
|
has "$W_CL" "spawn 2 parallel Task subagent(s)" "wave(claude): dispatches Task subagents"
|
|
116
116
|
no "$W_CL" "cckit orchestrate --agent codex" "wave(claude): no Codex launch line"
|
|
117
117
|
has "$W_CX" "cckit orchestrate --agent codex --detach 101 103" "wave(codex): cckit launches the wave-0 worktrees"
|
|
@@ -126,12 +126,12 @@ has "$W_BOTH" "### Codex" "wave(both): carries the Codex dispatch"
|
|
|
126
126
|
wave_data() { printf '%s\n' "$1" | sed -n '/^### #/,$p' | grep -v 'cckit watch --loop'; }
|
|
127
127
|
ok "$(wave_data "$W_CX")" "$(wave_data "$W_CL")" "wave: issue prompts + captain drive match across adapters"
|
|
128
128
|
has "$(wave_data "$W_CL")" "### #103" "wave: the compared wave data is not empty"
|
|
129
|
-
L_CL="$(cckit wave --adapter claude --llm 2>/dev/null)"
|
|
130
|
-
L_CX="$(cckit wave --adapter codex --llm 2>/dev/null)"
|
|
129
|
+
L_CL="$(cckit effort plan --wave --adapter claude --llm 2>/dev/null)"
|
|
130
|
+
L_CX="$(cckit effort plan --wave --adapter codex --llm 2>/dev/null)"
|
|
131
131
|
ok "$L_CX" "$L_CL" "wave --llm: byte-identical wave data for both adapters"
|
|
132
132
|
has "$L_CL" "101" "wave --llm: carries wave-0 issue #101"
|
|
133
133
|
no "$L_CL" "Task subagent" "wave --llm: the prompt names no runtime"
|
|
134
|
-
cckit wave --adapter cursor >/dev/null 2>&1; ok "$?" "2" "wave: an unknown adapter is refused"
|
|
134
|
+
cckit effort plan --wave --adapter cursor >/dev/null 2>&1; ok "$?" "2" "wave: an unknown adapter is refused"
|
|
135
135
|
|
|
136
136
|
echo "== next: surfaces the unblocked set + the top issue's start command =="
|
|
137
137
|
NEXT="$(CCKIT_OUTPUT=human cckit next 2>&1)"
|
|
@@ -154,7 +154,7 @@ ok "$(git -C "$TMP/repo" ls-remote --heads origin fix/103-b | wc -l | tr -d ' ')
|
|
|
154
154
|
ok "$(grep -c '^GH-SUBCOMMAND' "$GH_LOG")" "0" "the whole cycle so far ran no gh subcommand"
|
|
155
155
|
|
|
156
156
|
echo "== advance: merging #101 unblocks #102 into wave 0 =="
|
|
157
|
-
PLAN2="$(CCKIT_OUTPUT=human cckit plan --cap 8 2>&1)"
|
|
157
|
+
PLAN2="$(CCKIT_OUTPUT=human cckit effort plan --issues --cap 8 2>&1)"
|
|
158
158
|
no "$PLAN2" "#101 " "advance: #101 closed, gone from the board"
|
|
159
159
|
w102b="$(printf '%s' "$PLAN2" | awk '/^## Wave/{w=$3} /^\| #102 \|/{print w}')"
|
|
160
160
|
ok "$w102b" "0" "advance: #102 now unblocked in wave 0"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# shellcheck shell=bash
|
|
3
|
+
# force-push-fence-test.sh — #592: the fence fails the gate on a force push in a non-test file, names
|
|
4
|
+
# the offender, ignores comments and test files, and --write records the count. Fixture tree under
|
|
5
|
+
# mktemp -d; the real tree is at its baseline of 0.
|
|
6
|
+
# Run: bash scripts/force-push-fence-test.sh
|
|
7
|
+
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
8
|
+
set -u
|
|
9
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
10
|
+
fail=0
|
|
11
|
+
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
12
|
+
F="$ROOT/scripts/force-push-fence.sh"
|
|
13
|
+
|
|
14
|
+
bash "$F" >/dev/null; t "the real tree is at baseline" "$?" "0"
|
|
15
|
+
t "the real baseline is 0" "$(cat "$ROOT/scripts/force-push-fence.baseline")" "force=0"
|
|
16
|
+
|
|
17
|
+
fx="$(mktemp -d)"; trap 'rm -rf "$fx"' EXIT
|
|
18
|
+
mkdir -p "$fx/bin" "$fx/scripts/lib"
|
|
19
|
+
printf 'echo hi\n' > "$fx/bin/cckit"
|
|
20
|
+
printf 'sync() { git push origin "$1"; }\n' > "$fx/scripts/lib/clean.sh"
|
|
21
|
+
printf 'force=0\n' > "$fx/scripts/force-push-fence.baseline"
|
|
22
|
+
bash "$F" --root "$fx" >/dev/null; t "a clean tree passes" "$?" "0"
|
|
23
|
+
|
|
24
|
+
for bad in 'git push --force origin x' 'git push -f origin x' 'git push origin x --force' 'git push --force-with-lease origin x' 'push_it() { git push origin x --force-with-lease; }'; do
|
|
25
|
+
printf '%s\n' "$bad" > "$fx/scripts/lib/stray.sh"
|
|
26
|
+
out="$(bash "$F" --root "$fx")"; rc=$?
|
|
27
|
+
t "fails on: $bad" "$rc" "1"
|
|
28
|
+
t " names the offender" "$(printf '%s' "$out" | grep -c 'scripts/lib/stray.sh:1:')" "1"
|
|
29
|
+
done
|
|
30
|
+
|
|
31
|
+
printf '# never git push --force here\nx=1\n' > "$fx/scripts/lib/stray.sh"
|
|
32
|
+
bash "$F" --root "$fx" >/dev/null; t "a comment is not a call" "$?" "0"
|
|
33
|
+
printf 'git push --force origin x\n' > "$fx/scripts/lib/stray-test.sh"
|
|
34
|
+
bash "$F" --root "$fx" >/dev/null; t "a test file is skipped" "$?" "0"
|
|
35
|
+
rm "$fx/scripts/lib/stray-test.sh"
|
|
36
|
+
|
|
37
|
+
printf 'git push --force origin x\n' > "$fx/scripts/lib/stray.sh"
|
|
38
|
+
bash "$F" --root "$fx" --write >/dev/null
|
|
39
|
+
t "--write records the count" "$(cat "$fx/scripts/force-push-fence.baseline")" "force=1"
|
|
40
|
+
bash "$F" --root "$fx" >/dev/null; t "at the baseline passes" "$?" "0"
|
|
41
|
+
rm "$fx/scripts/force-push-fence.baseline"
|
|
42
|
+
bash "$F" --root "$fx" >/dev/null 2>&1; t "no baseline is rc 1" "$?" "1"
|
|
43
|
+
|
|
44
|
+
exit "$fail"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
force=0
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# force-push-fence.sh — #592: the gate fails when a non-test file under bin/ or scripts/ force-pushes.
|
|
3
|
+
# A pushed branch is brought onto its base by `git merge origin/<base>`, never by a rebase, so no
|
|
4
|
+
# push needs --force. The squash merge keeps history linear anyway.
|
|
5
|
+
#
|
|
6
|
+
# scripts/force-push-fence.sh rc 0 when the count is at or under the baseline, 1 over it
|
|
7
|
+
# scripts/force-push-fence.sh --root <dir> fence another checkout
|
|
8
|
+
# scripts/force-push-fence.sh --write write the current count into the baseline
|
|
9
|
+
#
|
|
10
|
+
# Counts non-comment lines in bin/* and scripts/**/*.sh (test files `*-test.sh` and `test-*.sh`, and
|
|
11
|
+
# this script, are skipped) that hold `push` with `--force`, `--force-with-lease` or `-f`, or the
|
|
12
|
+
# `--force-with-lease` flag on its own. Ratchet against scripts/force-push-fence.baseline (`force=<n>`).
|
|
13
|
+
# errors: strict — set -e; a missing baseline exits 1
|
|
14
|
+
set -euo pipefail
|
|
15
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
16
|
+
write=0
|
|
17
|
+
while [ $# -gt 0 ]; do
|
|
18
|
+
case "$1" in
|
|
19
|
+
--root) ROOT="$(cd "${2:?--root needs a directory}" && pwd)"; shift 2 ;;
|
|
20
|
+
--write) write=1; shift ;;
|
|
21
|
+
-h|--help) sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
|
22
|
+
*) echo "force-push-fence: unknown argument '$1'" >&2; exit 2 ;;
|
|
23
|
+
esac
|
|
24
|
+
done
|
|
25
|
+
baseline="$ROOT/scripts/force-push-fence.baseline"
|
|
26
|
+
|
|
27
|
+
# A forbidden push: `push` then --force / --force-with-lease / -f on one line, or a bare --force-with-lease.
|
|
28
|
+
re='push[^|;&]*(--force|[[:space:]]-f([[:space:]]|$))|--force-with-lease'
|
|
29
|
+
hits="$(cd "$ROOT" && { for f in bin/*; do [ -f "$f" ] && echo "$f"; done; for f in scripts/*.sh scripts/lib/*.sh; do [ -f "$f" ] && echo "$f"; done; } \
|
|
30
|
+
| grep -vE -- '-test\.sh$|(^|/)test-[a-z-]+\.sh$|^scripts/force-push-fence\.sh$' | sort -u | while IFS= read -r f; do
|
|
31
|
+
grep -nE "$re" "$f" | grep -vE '^[0-9]+:[[:space:]]*#' | sed "s|^|$f:|" || true
|
|
32
|
+
done)"
|
|
33
|
+
n="$(printf '%s\n' "$hits" | sed '/^$/d' | wc -l | tr -d ' ')"
|
|
34
|
+
|
|
35
|
+
if [ "$write" = 1 ]; then
|
|
36
|
+
printf 'force=%s\n' "$n" > "$baseline"
|
|
37
|
+
echo "force-push-fence: baseline written — force=$n"
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
[ -f "$baseline" ] || { echo "force-push-fence: no baseline at $baseline (run: scripts/force-push-fence.sh --write)" >&2; exit 1; }
|
|
41
|
+
max="$(sed -n 's/^force=//p' "$baseline" | sed -n 1p)"
|
|
42
|
+
case "$max" in *[!0-9]*|'') echo "force-push-fence: the baseline must hold force=<n>" >&2; exit 1 ;; esac
|
|
43
|
+
|
|
44
|
+
if [ "$n" -gt "$max" ]; then
|
|
45
|
+
echo "x force-push fence: $n force-push line(s) (baseline $max). Update the branch with git merge origin/<base> and push plain:"
|
|
46
|
+
printf '%s\n' "$hits" | sed '/^$/d' | sed 's/^/ /'
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
echo "ok force-push fence: $n/$max force-push lines in bin/ and scripts/"
|
|
50
|
+
if [ "$n" -lt "$max" ]; then echo " the count went down — ratchet it: scripts/force-push-fence.sh --write"; fi
|
|
51
|
+
exit 0
|
package/scripts/init.sh
CHANGED
|
@@ -1257,7 +1257,7 @@ safe_copy "$KIT_ROOT/scripts/lib/board-view.sh" "$TARGET/scripts/lib/board-v
|
|
|
1257
1257
|
safe_copy "$KIT_ROOT/scripts/lib/effort-plan.sh" "$TARGET/scripts/lib/effort-plan.sh"
|
|
1258
1258
|
safe_copy "$KIT_ROOT/scripts/lib/worktree-start.sh" "$TARGET/scripts/lib/worktree-start.sh"
|
|
1259
1259
|
# pr-evidence.sh is the helper rules/gate-and-review.md tells a project to source; without this copy
|
|
1260
|
-
# `cckit lib` resolves to the project's own scripts/lib, where the helper would be missing.
|
|
1260
|
+
# `cckit agent lib` resolves to the project's own scripts/lib, where the helper would be missing.
|
|
1261
1261
|
safe_copy "$KIT_ROOT/scripts/lib/pr-evidence.sh" "$TARGET/scripts/lib/pr-evidence.sh"
|
|
1262
1262
|
safe_copy "$KIT_ROOT/scripts/lib/session-registry.sh" "$TARGET/scripts/lib/session-registry.sh"
|
|
1263
1263
|
safe_copy "$KIT_ROOT/scripts/lib/kinds.sh" "$TARGET/scripts/lib/kinds.sh"
|
|
@@ -1425,7 +1425,7 @@ jq --arg g '$CLAUDE_PROJECT_DIR/.claude/hooks/guard-raw-git-ops.sh' \
|
|
|
1425
1425
|
echo " + .claude/hooks/guard-raw-git-ops.sh (PreToolUse Bash, wired in tracked settings.json: raw gh/git -> cckit verb)"
|
|
1426
1426
|
|
|
1427
1427
|
# ---- session-mail hook (all projects; init AND --upgrade; idempotent) ----
|
|
1428
|
-
# One script on four events delivers `cckit msg` mail to a running session (E257.5). Wired in the
|
|
1428
|
+
# One script on four events delivers `cckit agent msg` mail to a running session (E257.5). Wired in the
|
|
1429
1429
|
# TRACKED settings.json for the same reason as the raw-git guard: mail has to reach worktrees. A
|
|
1430
1430
|
# registration that is already there is left as it is (its timeout or position may be the user's),
|
|
1431
1431
|
# and a project that listed the hook in `upgrade.removed` is not re-wired.
|
|
@@ -172,6 +172,11 @@ pv2="$(project pv2 '{"github":{"projectsV2":true,"repo":"o/r","baseBranch":"main
|
|
|
172
172
|
out="$(doctor "$tmp/h1" "$pv2" --dry-run)"
|
|
173
173
|
has "token scope: Projects v2 on, a token with no scope header -> a skip row for a fine-grained token" "$(frow "$out" 'token scope:project')" "- token scope:project a fine-grained token lists no scopes — give it Projects access if the board stays empty"
|
|
174
174
|
has "base branch: read from GET repos/<r> default_branch" "$(cat "$GH_LOG")" "GET repos/o/r "
|
|
175
|
+
# The loose-issue row (E546.2): the count only; the default shim issues are an effort and a PR.
|
|
176
|
+
has "loose issues: a repo -> one ok row with the count" "$(frow "$out" 'loose issues')" "ok loose issues 0 in o/r"
|
|
177
|
+
has "loose issues: no repository -> a skip row" "$(frow "$out_bare" 'loose issues')" "- loose issues skipped — no repository"
|
|
178
|
+
out="$(DOCTOR_FORGE=none DOCTOR_TOKEN= doctor "$tmp/h1" "$pv2" --dry-run)"
|
|
179
|
+
has "loose issues: no forge -> a skip row, never a silent pass" "$(frow "$out" 'loose issues')" "- loose issues skipped — no forge"
|
|
175
180
|
rm -f "$stubs/gh"
|
|
176
181
|
: > "$log"
|
|
177
182
|
out="$(doctor "$tmp/h1" "$bare" --dry-run)"; r=$?
|