@jeiemgi/cckit 0.7.1 → 0.9.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 +15 -4
- package/README.md +25 -3
- package/bin/cckit +91 -8
- package/cckit.config.json +1 -1
- package/kit.config.schema.json +43 -2
- package/package.json +1 -1
- package/scripts/autopilot-test.sh +68 -0
- package/scripts/autopilot.sh +16 -10
- package/scripts/check.sh +14 -1
- package/scripts/copilot-loop-test.sh +3 -0
- package/scripts/guard-raw-git-ops-test.sh +73 -0
- package/scripts/init.sh +68 -8
- package/scripts/lib/agent-profile-test.sh +151 -0
- package/scripts/lib/agent-profile.sh +195 -0
- package/scripts/lib/agent-resolve-test.sh +156 -0
- package/scripts/lib/agent-resolve.sh +177 -0
- package/scripts/lib/branch-owner-test.sh +99 -0
- package/scripts/lib/branch-owner.sh +194 -0
- package/scripts/lib/captain-test.sh +86 -0
- package/scripts/lib/captain.sh +142 -7
- package/scripts/lib/contribute-root-test.sh +40 -0
- package/scripts/lib/contribute-root.sh +22 -0
- package/scripts/lib/effort-metrics.sh +14 -1
- package/scripts/lib/effort-ops-test.sh +54 -2
- package/scripts/lib/effort-ops.sh +243 -23
- package/scripts/lib/effort-parity-test.sh +5 -3
- package/scripts/lib/effort-slug.sh +16 -2
- package/scripts/lib/effort.sh +49 -15
- package/scripts/lib/gh-project.sh +14 -0
- package/scripts/lib/gh-rest-test.sh +301 -0
- package/scripts/lib/gh-rest.sh +289 -0
- package/scripts/lib/hook-refresh-test.sh +65 -0
- package/scripts/lib/hook-refresh.sh +62 -0
- package/scripts/lib/kit-config.sh +6 -0
- package/scripts/lib/kit-gc-test.sh +178 -1
- package/scripts/lib/kit-gc.sh +251 -55
- package/scripts/lib/kit-task-ops-test.sh +15 -0
- package/scripts/lib/kit-task-ops.sh +231 -58
- package/scripts/lib/kto-task-close-test.sh +83 -0
- package/scripts/lib/kto-task-pr-merge-test.sh +129 -0
- package/scripts/lib/kto-task-pr-test.sh +59 -0
- package/scripts/lib/orchestration-runtime-test.sh +142 -0
- package/scripts/lib/orchestration-runtime.sh +171 -0
- package/scripts/lib/review-stage-test.sh +241 -0
- package/scripts/lib/review-stage.sh +259 -0
- package/scripts/lib/stage-receipt-test.sh +252 -0
- package/scripts/lib/stage-receipt.sh +442 -0
- package/scripts/lib/test-env-test.sh +25 -0
- package/scripts/lib/test-env.sh +33 -0
- package/scripts/lib/worker-brief-test.sh +120 -0
- package/scripts/lib/worker-brief.sh +185 -0
- package/scripts/lib/worktree-issue.sh +14 -0
- package/scripts/lib/worktree-ports-test.sh +146 -0
- package/scripts/lib/worktree-start.sh +153 -8
- package/scripts/lib/zsh-safety-test.sh +67 -0
- package/scripts/orchestrate.sh +124 -22
- package/scripts/portable-test.sh +22 -1
- package/scripts/review-lint-baseline.txt +28 -0
- package/scripts/review-lint-test.sh +271 -0
- package/scripts/review-lint.sh +259 -0
- package/scripts/review-rules.conf +55 -0
- package/scripts/setup-labels.sh +21 -1
- package/scripts/skill-frontmatter-baseline.txt +24 -0
- package/scripts/skill-frontmatter-lint-test.sh +156 -0
- package/scripts/skill-frontmatter-lint.sh +182 -0
- package/scripts/task-sync.sh +8 -0
- package/scripts/test.sh +10 -1
- package/skills/kit-autopilot/SKILL.md +13 -1
- package/skills/kit-cleanup/SKILL.md +5 -3
- package/skills/kit-contribute/SKILL.md +6 -5
- package/skills/kit-effort-close/SKILL.md +8 -3
- package/skills/kit-effort-pr/SKILL.md +16 -95
- package/skills/kit-gc/SKILL.md +15 -10
- package/skills/kit-security-sweep/SKILL.md +4 -6
- package/skills/kit-ship/SKILL.md +1 -1
- package/skills/kit-task-pr/SKILL.md +2 -0
- package/templates/hooks/guard-raw-git-ops.sh.tmpl +193 -0
- package/templates/rules/branch-naming.md +6 -0
- package/templates/rules/effort-model.md +3 -0
- package/templates/rules/naming-and-ids.md +4 -1
- package/templates/settings/settings.json.tmpl +4 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cckit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"installationPreference": "beta",
|
|
5
5
|
"description": "cckit — a project operating system for coding agents. The full GitHub work lifecycle (start/pr/close/sync, efforts, worktrees, orchestrate, gc) as agents + skills + rules, drivable by Claude Code and any other agent. Driven from cckit.config.json; no org or repo hardcoded.",
|
|
6
6
|
"author": {
|
package/AGENTS.md
CHANGED
|
@@ -63,10 +63,10 @@ the same commit.
|
|
|
63
63
|
| `cckit effort chain <a> <b> [<c> …]` | wire 2+ issues into a linear order: `b` `blocked_by` `a`, `c` `blocked_by` `b`, plus a `- Depends on #<predecessor>` line in each successor's `## Relations` section. These are the edges `cckit plan` layers into waves. Idempotent (an edge or line already there is skipped); pre-existing blockers are kept, never replaced. Validates everything first — fewer than two numbers, a non-numeric arg, an issue that does not exist, a repeated number, or an edge that would close a cycle refuses the whole chain and writes nothing | — |
|
|
64
64
|
| `cckit effort start [--force] <slug\|N> [slug]` | effort branch + bootstrapped worktree, **WIP-limited**: refuses a NEW effort once `effort.wipLimit` (default 2) are already in progress. In progress = an `effort/<N>-<slug>` branch exists as a local head **or** on origin, read with `git ls-remote` rather than the cached `refs/remotes` (which is wrong both ways: it misses a branch pushed since the last fetch and keeps one deleted on origin until a prune). At the limit refuses; only strictly under it starts. Re-starting an effort that is already in progress is never gated. The check runs before the fetch/branch/worktree/bootstrap, so a refusal makes no branch, no worktree and no board change — it is not read-free (it queries origin, and a `<slug>` arg was resolved first, which can run `gh issue list`). `0` refuses every ordinary start; `--force` still starts. A non-integer value is ignored with a warning and the default 2 is used; `EFFORT_WIP_LIMIT` overrides the config per invocation. `EFFORT_WIP_REMOTE=0` — or an unreachable origin, which warns and proceeds — counts the cached refs instead. Does **not** gate `cckit start <issue>` | `--force`, or `KIT_FORCE=1` |
|
|
65
65
|
| `cckit effort plan` | session-fit effort plan | `--llm` → JSON |
|
|
66
|
-
| `cckit orchestrate <a> <b> …` | run N flows in parallel worktrees | — (use `--dry-run`) |
|
|
67
|
-
| `cckit autopilot [<a> …]` |
|
|
68
|
-
| `cckit gc` | report prunable branches + worktrees — never one whose issue is still open; aborts if the protection helper is missing | `--llm` → JSON counts |
|
|
69
|
-
| `cckit cleanup [--yes]` | the guided destructive sweep over that report: plan first, delete only the SAFE rows and prune the listed ZOMBIE metadata (staged work recovered to its branch first); ORPHAN / PROTECTED / stashes are never deletable | `--llm` → JSON counts + `applied` |
|
|
66
|
+
| `cckit orchestrate <a> <b> …` | run N flows in parallel worktrees, in tmux or Herdr | — (use `--dry-run`) |
|
|
67
|
+
| `cckit autopilot [<a> …]` | select work, then call `orchestrate --detach` under a cap | — (use `--dry-run`) |
|
|
68
|
+
| `cckit gc` | report prunable branches + worktrees — SAFE (own PR merged) and LANDED (no PR of its own, work already on base: effort subs, `worktree-agent-*` isolation worktrees) — never one whose issue is still open; aborts if the protection helper is missing | `--llm` → JSON counts (`safe`, `landed`, `protected`, `orphan`) |
|
|
69
|
+
| `cckit cleanup [--yes]` | the guided destructive sweep over that report: plan first, delete only the SAFE + LANDED rows and prune the listed ZOMBIE metadata (staged work recovered to its branch first); ORPHAN / PROTECTED / stashes are never deletable | `--llm` → JSON counts + `applied` |
|
|
70
70
|
| `cckit render` | stdin markdown → rich (glow on a TTY; verbatim when piped) | — |
|
|
71
71
|
| `cckit version` | the installed cckit version | `--llm` |
|
|
72
72
|
|
|
@@ -102,6 +102,8 @@ Every operation an unattended run needs is reachable through the one CLI:
|
|
|
102
102
|
| `--dry-run` | resolve + print the launch plan; create no worktrees, start nothing |
|
|
103
103
|
| `--cap <N>` | concurrency cap (default 4); flows past the cap are queued + reported |
|
|
104
104
|
| `--agent <cmd>` | per-pane agent command (default `claude`, or `CCKIT_AGENT=`) — drive any CLI agent |
|
|
105
|
+
| `--profile <name>` | run a declared agent profile (or `CCKIT_PROFILE=`): its `kind` becomes the agent and its `args` are passed to the CLI. Unset picks the cheapest-tier profile; `--agent` overrides and skips profiles entirely. A project that declares none is unaffected |
|
|
106
|
+
| `--runtime <tmux\|herdr>` | terminal owner (default `tmux`, or `CCKIT_RUNTIME=`); Herdr requires a supported agent kind such as `codex` or `claude` |
|
|
105
107
|
| `--force` | launch even if an issue is `blocked_by` an OPEN issue (the gate is on by default) |
|
|
106
108
|
| `--no-seed` | start the agent without an auto-prompt |
|
|
107
109
|
|
|
@@ -119,6 +121,15 @@ cckit shells out to whatever agent invokes it; it does not embed a model. For ve
|
|
|
119
121
|
text (digests, ingest), the model endpoint is configurable via environment — see the docs site (
|
|
120
122
|
[cckit.dev](https://cckit.dev).
|
|
121
123
|
|
|
124
|
+
**Agent profiles** (`agents.profiles` in the config) carry a spend `tier`, a permission policy and
|
|
125
|
+
extra CLI argv. **cckit never names a model** — you spell your own flags in `args`, and the
|
|
126
|
+
cheapest-tier profile runs when `agents.default` is unset, so the inexpensive path is the default
|
|
127
|
+
by construction. A profile also declares the `stages` it may run at and whether it may
|
|
128
|
+
`write` to a branch; a profile with no `stages` is allowed nowhere, and `write` defaults to false.
|
|
129
|
+
Validation refuses an undeclared profile, a missing `kind`, an unknown stage, or a dangling
|
|
130
|
+
`agents.default` **before** a worktree or pane exists. See
|
|
131
|
+
[Agent profiles](https://cckit.dev/config-and-permissions/#agent-profiles).
|
|
132
|
+
|
|
122
133
|
## Paste-ready agent prompt
|
|
123
134
|
|
|
124
135
|
Drop this verbatim into your agent's system prompt (or the first message of a session) to make it
|
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ cckit pr 42 "what changed" # commit, push, open the PR
|
|
|
104
104
|
cckit sync # board state, what's unblocked
|
|
105
105
|
cckit handoff "resume note" # save a handoff — bare `cckit` prints it next session
|
|
106
106
|
cckit gc # report prunable branches + worktrees (deletes nothing)
|
|
107
|
-
cckit cleanup [--yes] # act on that report: delete the SAFE rows, prune listed zombies, keep orphans/stashes
|
|
107
|
+
cckit cleanup [--yes] # act on that report: delete the SAFE + LANDED rows, prune listed zombies, keep orphans/stashes
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
Adopting cckit in a repo that already has history? `cckit scan` detects the stack, `cckit adopt`
|
|
@@ -205,13 +205,21 @@ that gate and merge themselves. This is the part that turns one keyboard into a
|
|
|
205
205
|
```bash
|
|
206
206
|
cckit plan # the wave plan: deps-ordered, p0-first inside a wave, file-disjoint
|
|
207
207
|
cckit wave # a Task-subagent fan-out brief Claude Code enacts (proposes the next wave)
|
|
208
|
-
cckit orchestrate 12 14 17 # run N flows in parallel worktrees (
|
|
208
|
+
cckit orchestrate 12 14 17 # run N flows in parallel worktrees (tmux by default)
|
|
209
|
+
cckit orchestrate --runtime herdr --agent codex 12 14 17 # persistent, state-aware agent terminals
|
|
209
210
|
cckit watch --merge # the captain: gate open PRs, squash-merge the CLEAN ones, advance
|
|
210
211
|
# (policy floors hold PRs touching CI, lockfiles, or secrets for review)
|
|
211
212
|
cckit watch --loop # self-pace gate/merge passes until steady state
|
|
212
|
-
cckit autopilot #
|
|
213
|
+
cckit autopilot # select unblocked work, then call orchestrate --detach under a cap
|
|
213
214
|
```
|
|
214
215
|
|
|
216
|
+
Set `review.command` in your config and the captain sends every PR it would merge to an agent
|
|
217
|
+
reviewer first, records the verdict as a stage receipt, and refuses to merge on a `fail`. You name
|
|
218
|
+
the command that runs the reviewer — cckit pipes it a brief on stdin and reads the report off
|
|
219
|
+
stdout, so it asserts nothing about any agent's flags. A PR with **no** verdict recorded reads
|
|
220
|
+
`verify`, never merges silently: absence of evidence is not a pass. Off until you configure it.
|
|
221
|
+
→ [the agent review stage](https://cckit.dev/config-and-permissions/#the-agent-review-stage)
|
|
222
|
+
|
|
215
223
|
## Driven by agents
|
|
216
224
|
|
|
217
225
|
cckit is meant to be operated by an agent loop, not only a human. See [`AGENTS.md`](AGENTS.md) for
|
|
@@ -229,6 +237,20 @@ transcript, pipe-safe everywhere. Every human-facing verb (`sync`, `plan`, `next
|
|
|
229
237
|
one rendering seam, so board tables, wave plans, and the status dashboard read the same in every
|
|
230
238
|
surface and never leak escape codes down a pipe (`cckit render` exposes the seam for any script).
|
|
231
239
|
|
|
240
|
+
### Cloud sessions
|
|
241
|
+
|
|
242
|
+
Claude Code cloud sessions reach GitHub through a proxy that refuses GraphQL, and `gh pr` /
|
|
243
|
+
`gh issue` use GraphQL. There cckit switches to REST (`gh api repos/<owner>/<repo>/…`):
|
|
244
|
+
|
|
245
|
+
- **Works:** `cckit pr`, `merge`, `close`, `new`, `effort new`, `effort pr`, `effort close`, plus
|
|
246
|
+
the issue reads behind `start` and `effort start`.
|
|
247
|
+
- **Skipped:** board (Projects v2) steps, with one line on stderr: `cckit: board step skipped …`.
|
|
248
|
+
Turn on the board's built-in workflows (item closed → Done, PR merged → Done, auto-add) and the
|
|
249
|
+
card still moves. Remote branch deletion is skipped too: the proxy rejects it. Delete merged
|
|
250
|
+
branches on GitHub.
|
|
251
|
+
- **Switch:** `CCKIT_GH_TRANSPORT=rest|graphql` forces a transport. Unset, it is `rest` when
|
|
252
|
+
`CLAUDE_CODE_REMOTE=true` and the `gh` subcommands otherwise.
|
|
253
|
+
|
|
232
254
|
## cckit builds cckit
|
|
233
255
|
|
|
234
256
|
None of this is theoretical. cckit is developed *with* cckit — every feature, fix, and tutorial went
|
package/bin/cckit
CHANGED
|
@@ -10,8 +10,14 @@
|
|
|
10
10
|
# cckit init --profile <p> scaffold cckit.config.json + .claude/ (--profile required)
|
|
11
11
|
# cckit start <issue> [slug] isolated worktree + branch for an issue
|
|
12
12
|
# cckit pr <issue> <summary> commit + push + open the PR
|
|
13
|
-
# cckit close <issue> <summary>
|
|
13
|
+
# cckit close <issue> <summary> [--reason completed|not-planned|duplicate] [--duplicate-of N]
|
|
14
|
+
# [--superseded-by N] close the issue with a reason + summary comment; board Done
|
|
15
|
+
# cckit new [--role R --kind K --priority P --milestone M --blocked-by "#1" --body B|--body-file F] "<title>"
|
|
16
|
+
# file ONE issue: labels + board (Todo) in one step (never raw gh issue create)
|
|
17
|
+
# cckit merge [<pr>] [--merge|--rebase] merge the PR (squash by default; rebases on conflict), close
|
|
18
|
+
# its issues, GC the branch, update the PR's base (develop or effort/<N>)
|
|
14
19
|
# cckit contribute "<summary>" open a contribution PR to cckit, gated on scripts/check.sh
|
|
20
|
+
# (from the cckit checkout or worktree you are in; else the installed one)
|
|
15
21
|
# cckit sync [--llm] board state / what's unblocked
|
|
16
22
|
# cckit plan [--llm] [--effort N] wave plan: deps-ordered, p0-first in a wave, file-disjoint (TOON --llm)
|
|
17
23
|
# cckit plan-next [--llm] forward plan: current skills/verbs/rules/docs -> what to build next
|
|
@@ -27,13 +33,15 @@
|
|
|
27
33
|
# EFFORT_WIP_REMOTE=0 or an unreachable origin uses the cache and still starts). Refuses
|
|
28
34
|
# before writing anything; --force (or KIT_FORCE=1) starts anyway, at limit 0 too.
|
|
29
35
|
# `cckit start <issue>` is not affected.
|
|
30
|
-
#
|
|
36
|
+
# effort pr [<N>] [--summary S|--summary-file F] [--for-agents A|--for-agents-file F] [--title T]
|
|
37
|
+
# the ONE effort PR: inherits labels + milestone, rich body, board In Review
|
|
38
|
+
# cckit orchestrate <a> <b> … run N flows in parallel worktrees (--runtime tmux|herdr)
|
|
31
39
|
# cckit autopilot [<a> …] unattended multi-flow: drive (or auto-pick) issues under a cap
|
|
32
40
|
# cckit watch [--merge] [--loop] captain: gate open PRs, squash-merge CLEAN, advance the wave
|
|
33
41
|
# cckit next [--effort N] everyday helper: the unblocked set + how to start the top issue
|
|
34
42
|
# cckit wave [--effort N] read open efforts, propose incoming waves: fan-out + captain drive
|
|
35
43
|
# cckit msg <send|read|list> session mail across projects: steer a live session (--steer)
|
|
36
|
-
# cckit gc [--prune [--yes]] report (default) or prune merged branches
|
|
44
|
+
# cckit gc [--prune [--yes]] report (default) or prune merged + landed branches and worktrees
|
|
37
45
|
# cckit cleanup [--yes] guided destructive sweep over the gc report (plan first)
|
|
38
46
|
# cckit status thin dashboard: board + worktrees + resume handoff
|
|
39
47
|
# cckit scan [--llm] detect this repo's stack + kit state (JSON)
|
|
@@ -51,6 +59,7 @@
|
|
|
51
59
|
# cckit commands [--llm] list every verb (the command catalog)
|
|
52
60
|
# cckit lib [--llm] [--all] list every scripts/lib helper: functions, purpose, error contract
|
|
53
61
|
# cckit brief <issue> the delegation brief for an issue, from real state
|
|
62
|
+
# cckit receipt <issue> … record/read one stage receipt (a worker's durable report)
|
|
54
63
|
# cckit completions [bash|zsh] print a shell-completion script to source
|
|
55
64
|
# cckit help
|
|
56
65
|
set -eu
|
|
@@ -141,7 +150,12 @@ case "$cmd" in
|
|
|
141
150
|
effort_new "$@" ;;
|
|
142
151
|
chain) effort_chain "$@" ;;
|
|
143
152
|
start) effort_start "$@" ;;
|
|
144
|
-
pr)
|
|
153
|
+
pr)
|
|
154
|
+
# role-identity gives the PR its role title, commit trailer and signature; the board
|
|
155
|
+
# helpers load lazily inside effort_pr (_eo_source_board).
|
|
156
|
+
# shellcheck source=/dev/null
|
|
157
|
+
source "$LIB/role-identity.sh" 2>/dev/null || true
|
|
158
|
+
effort_pr "$@" ;;
|
|
145
159
|
close) effort_close "$@" ;;
|
|
146
160
|
plan) source "$LIB/effort-plan.sh"; effort_plan "$@" ;;
|
|
147
161
|
*) echo "cckit effort <new|chain|start|pr|close|plan>" >&2; exit 2 ;;
|
|
@@ -167,6 +181,8 @@ case "$cmd" in
|
|
|
167
181
|
source "$LIB/kit-config.sh" && load_kit_config
|
|
168
182
|
# shellcheck source=/dev/null
|
|
169
183
|
source "$LIB/role-identity.sh"; source "$LIB/gh-project.sh"; source "$LIB/kit-task-ops.sh"
|
|
184
|
+
if [ "$cmd" = close ]; then case "${1:-}" in -h|--help)
|
|
185
|
+
echo 'cckit close <issue> ["<summary>"] [--reason completed|not-planned|duplicate] [--duplicate-of N] [--superseded-by N]'; exit 0 ;; esac; fi
|
|
170
186
|
if cckit_is_json; then
|
|
171
187
|
case "$cmd" in
|
|
172
188
|
pr) out="$(kto_task_pr "$@" 2>&1)"; rc=$? ;;
|
|
@@ -182,6 +198,53 @@ case "$cmd" in
|
|
|
182
198
|
close) kto_task_close "$@" ;;
|
|
183
199
|
esac
|
|
184
200
|
;;
|
|
201
|
+
new)
|
|
202
|
+
# File ONE issue through kto_task_new (labels + board add + Role/Status fields). This verb is why
|
|
203
|
+
# an agent never needs raw `gh issue create`, which skips the board (#361). Multi-part work is
|
|
204
|
+
# `cckit effort new`. Defaults: kind task, priority p2; role from --role or KIT_DEFAULT_ROLE.
|
|
205
|
+
# shellcheck source=/dev/null
|
|
206
|
+
source "$LIB/kit-config.sh" && load_kit_config
|
|
207
|
+
# shellcheck source=/dev/null
|
|
208
|
+
source "$LIB/role-identity.sh"; source "$LIB/gh-project.sh"; source "$LIB/kit-task-ops.sh"
|
|
209
|
+
n_role="${KIT_DEFAULT_ROLE:-}"; n_kind="task"; n_prio="p2"; n_ms=""; n_plan=""; n_blocked=""; n_body=""; n_title=""
|
|
210
|
+
while [ $# -gt 0 ]; do
|
|
211
|
+
case "$1" in
|
|
212
|
+
--role) n_role="${2:-}"; shift 2 ;;
|
|
213
|
+
--kind) n_kind="${2:-}"; shift 2 ;;
|
|
214
|
+
--priority) n_prio="${2:-}"; shift 2 ;;
|
|
215
|
+
--milestone) n_ms="${2:-}"; shift 2 ;;
|
|
216
|
+
--plan) n_plan="${2:-}"; shift 2 ;;
|
|
217
|
+
--blocked-by) n_blocked="${2:-}"; shift 2 ;;
|
|
218
|
+
--body) n_body="${2:-}"; shift 2 ;;
|
|
219
|
+
--body-file) n_body="$(cat "${2:-/dev/null}")"; shift 2 ;;
|
|
220
|
+
-h|--help) echo 'cckit new [--role R --kind K --priority P --milestone M --plan L --blocked-by "#1" --body B|--body-file F] "<title>"'; exit 0 ;;
|
|
221
|
+
--) shift; n_title="${n_title:+$n_title }$*"; break ;;
|
|
222
|
+
-*) echo "cckit new: unknown flag $1" >&2; exit 2 ;;
|
|
223
|
+
*) n_title="${n_title:+$n_title }$1"; shift ;;
|
|
224
|
+
esac
|
|
225
|
+
done
|
|
226
|
+
[ -n "$n_title" ] || { echo 'cckit new: a title is required — cckit new --role R "<title>"' >&2; exit 2; }
|
|
227
|
+
[ -n "$n_role" ] || { echo 'cckit new: --role is required (or set KIT_DEFAULT_ROLE)' >&2; exit 2; }
|
|
228
|
+
if cckit_is_json; then
|
|
229
|
+
rc=0; out="$(kto_task_new "$n_title" "$n_role" "$n_kind" "$n_prio" "$n_ms" "$n_plan" "$n_blocked" "$n_body" 2>&1)" || rc=$?
|
|
230
|
+
url="$(printf '%s' "$out" | grep -oE 'https://[^ ]+/issues/[0-9]+' | tail -1)"
|
|
231
|
+
cckit_json verb new issue "$(basename "${url:-x}")" ok "$([ "$rc" -eq 0 ] && echo true || echo false)" \
|
|
232
|
+
url "$url" detail "$(printf '%s' "$out" | tail -1)"
|
|
233
|
+
exit "$rc"
|
|
234
|
+
fi
|
|
235
|
+
kto_task_new "$n_title" "$n_role" "$n_kind" "$n_prio" "$n_ms" "$n_plan" "$n_blocked" "$n_body"; echo
|
|
236
|
+
;;
|
|
237
|
+
merge)
|
|
238
|
+
# Merge (squash by default, --merge / --rebase, #376) through kto_task_pr_merge: rebase on conflict, close the PR's linked issues (native
|
|
239
|
+
# auto-close only fires on the default branch), then clean the branch + worktree. The verb behind
|
|
240
|
+
# every raw `gh pr merge` (#361). An effort's PR merges with `cckit effort close <N>`.
|
|
241
|
+
# shellcheck source=/dev/null
|
|
242
|
+
source "$LIB/kit-config.sh" && load_kit_config
|
|
243
|
+
# shellcheck source=/dev/null
|
|
244
|
+
source "$LIB/role-identity.sh"; source "$LIB/gh-project.sh"; source "$LIB/kit-task-ops.sh"
|
|
245
|
+
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
|
|
246
|
+
kto_task_pr_merge "$@"
|
|
247
|
+
;;
|
|
185
248
|
sync) exec "$ROOT/scripts/task-sync.sh" "$@" ;;
|
|
186
249
|
plan)
|
|
187
250
|
# Wave plan over the board (deps-ordered, file-disjoint, session-fit). Runs in the invoking
|
|
@@ -217,6 +280,7 @@ case "$cmd" in
|
|
|
217
280
|
out="$(kit_gc_cleanup "$@" 2>"$cleanup_err")" || cleanup_rc=$?
|
|
218
281
|
safe="$(printf '%s\n' "$out" | awk '/^ SAFE branches/{print $3}')"
|
|
219
282
|
wt="$(printf '%s\n' "$out" | awk '/^ SAFE worktrees/{print $3}')"
|
|
283
|
+
landed="$(printf '%s\n' "$out" | awk '/^ LANDED branches/{print $3}')"
|
|
220
284
|
orphan="$(printf '%s\n' "$out" | awk '/^ ORPHAN kept/{print $3}')"
|
|
221
285
|
protected="$(printf '%s\n' "$out" | awk '/^ PROTECTED kept/{print $3}')"
|
|
222
286
|
stash="$(printf '%s\n' "$out" | awk '/^ stashes kept/{print $3}')"
|
|
@@ -225,7 +289,7 @@ case "$cmd" in
|
|
|
225
289
|
applied=no
|
|
226
290
|
if [ "$cleanup_rc" -eq 0 ]; then case " $* " in *" --yes "*|*" -y "*) applied=yes ;; esac; fi
|
|
227
291
|
err="$(tr '\n' ' ' < "$cleanup_err" | sed 's/[[:space:]]*$//')"; rm -f "$cleanup_err"
|
|
228
|
-
cckit_json verb cleanup safe "${safe:-0}" worktrees "${wt:-0}" orphan "${orphan:-0}" \
|
|
292
|
+
cckit_json verb cleanup safe "${safe:-0}" landed "${landed:-0}" worktrees "${wt:-0}" orphan "${orphan:-0}" \
|
|
229
293
|
protected "${protected:-0}" stash "${stash:-0}" zombie "${zombie:-0}" applied "$applied" \
|
|
230
294
|
remote_failed "${rfail:-0}" rc "$cleanup_rc" error "$err"
|
|
231
295
|
[ "$cleanup_rc" -eq 0 ] || exit "$cleanup_rc"
|
|
@@ -240,16 +304,18 @@ case "$cmd" in
|
|
|
240
304
|
source "$LIB/kit-gc.sh"
|
|
241
305
|
case " $* " in
|
|
242
306
|
*" --prune "*|*" prune "*)
|
|
243
|
-
# Remove worktrees + local branches whose PR merged
|
|
307
|
+
# Remove worktrees + local branches whose PR merged (SAFE) or whose work is already on base
|
|
308
|
+
# with no PR of their own (LANDED, #388). Dry-run unless --yes.
|
|
244
309
|
kit_gc_prune "$@"
|
|
245
310
|
;;
|
|
246
311
|
*)
|
|
247
312
|
if cckit_is_json; then
|
|
248
313
|
out="$(kit_gc_analyze 2>/dev/null || true)"
|
|
249
314
|
safe="$(printf '%s\n' "$out" | grep -c '> SAFE ' || true)"
|
|
315
|
+
landed="$(printf '%s\n' "$out" | grep -c '> LANDED ' || true)"
|
|
250
316
|
protected="$(printf '%s\n' "$out" | grep -c 'PROTECTED:' || true)"
|
|
251
317
|
orphan="$(printf '%s\n' "$out" | grep -c 'ORPHAN' || true)"
|
|
252
|
-
cckit_json verb gc safe "$safe" protected "$protected" orphan "$orphan"
|
|
318
|
+
cckit_json verb gc safe "$safe" landed "$landed" protected "$protected" orphan "$orphan"
|
|
253
319
|
else
|
|
254
320
|
kit_gc_analyze "$@"
|
|
255
321
|
fi
|
|
@@ -325,7 +391,14 @@ case "$cmd" in
|
|
|
325
391
|
encode-context) source "$LIB/toon.sh"; toon_encode ;;
|
|
326
392
|
render) source "$LIB/render.sh"; cckit_render ;;
|
|
327
393
|
debug) exec "$ROOT/scripts/debug.sh" "$@" ;;
|
|
328
|
-
contribute)
|
|
394
|
+
contribute)
|
|
395
|
+
# The cckit checkout containing cwd (a worktree, per the rules) wins over the installed one, so
|
|
396
|
+
# the gate runs on — and the PR opens from — the branch being worked on (#368).
|
|
397
|
+
# shellcheck source=/dev/null
|
|
398
|
+
source "$LIB/contribute-root.sh"
|
|
399
|
+
croot="$(contribute_root "$PWD" "$ROOT")"
|
|
400
|
+
[ "$croot" = "$ROOT" ] || echo "contribute: using the checkout at $croot" >&2
|
|
401
|
+
cd "$croot"; exec "$croot/scripts/contribute.sh" "$@" ;;
|
|
329
402
|
status|ui) exec "$ROOT/scripts/status.sh" "$@" ;;
|
|
330
403
|
resume) source "$LIB/handoff.sh"; handoff_read ;;
|
|
331
404
|
handoff) source "$LIB/handoff.sh"; handoff_write "$@" ;;
|
|
@@ -373,6 +446,16 @@ case "$cmd" in
|
|
|
373
446
|
source "$LIB/kit-brief.sh"
|
|
374
447
|
CCKIT_ROOT="$ROOT" kit_brief "$@"
|
|
375
448
|
;;
|
|
449
|
+
|
|
450
|
+
receipt)
|
|
451
|
+
# One durable record per stage attempt (#322). The WORKER calls this itself: cckit never reads
|
|
452
|
+
# pane output, because #326 requires that pane history — off by default, and able to hold
|
|
453
|
+
# secrets — is never a dependency. The report arrives on stdin in the shape `cckit brief`'s
|
|
454
|
+
# receipt contract asked for, so the prompt and this parser cannot drift apart.
|
|
455
|
+
# shellcheck source=/dev/null
|
|
456
|
+
source "$LIB/stage-receipt.sh"
|
|
457
|
+
sr_cli "$@"
|
|
458
|
+
;;
|
|
376
459
|
completions)
|
|
377
460
|
case "${1:-bash}" in
|
|
378
461
|
bash) cat "$ROOT/completions/cckit.bash" ;;
|
package/cckit.config.json
CHANGED
package/kit.config.schema.json
CHANGED
|
@@ -64,6 +64,14 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"milestones": { "type": "array", "items": { "type": "string" } },
|
|
67
|
+
"pr": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": true,
|
|
70
|
+
"properties": {
|
|
71
|
+
"titleStyle": { "type": "string", "enum": ["conventional", "issue-title"], "default": "conventional", "description": "How `cckit pr` titles a single-issue PR. conventional (default): a Conventional Commits subject derived from the kind label, which release-please and a commitlint gate read. issue-title: the issue title, verbatim." },
|
|
72
|
+
"orchestratorSection": { "type": "boolean", "default": false, "description": "When true, `cckit pr` opens the PR body with a two-line `## For the orchestrator` section: the issue number and what to review." }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
67
75
|
"effort": {
|
|
68
76
|
"type": "object",
|
|
69
77
|
"additionalProperties": true,
|
|
@@ -73,6 +81,33 @@
|
|
|
73
81
|
"wipLimit": { "type": "integer", "minimum": 0, "description": "How many efforts may be in progress at once before `cckit effort start` refuses a NEW effort (default 2). In progress = an `effort/<N>-<slug>` branch exists as a local head or on origin (read with `git ls-remote`, not the cached refs/remotes; EFFORT_WIP_REMOTE=0 or an unreachable origin counts the cached refs instead). Refusal happens before anything is written; `--force` (or KIT_FORCE=1) starts anyway. 0 refuses every ordinary start of a NEW effort but not a forced one, and not a re-start of an effort already in progress (that adds no WIP, so it is never gated); a non-integer value is ignored with a warning and the default is used. An explicit EFFORT_WIP_LIMIT env var wins per invocation. Does not affect `cckit start <issue>`." }
|
|
74
82
|
}
|
|
75
83
|
},
|
|
84
|
+
"agents": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": true,
|
|
87
|
+
"description": "Named agent profiles and the stage vocabulary they are allowed at. A profile declares a SPEND POSTURE (`tier`) and the CLI arguments to run (`args`) — cckit never names a model, so it cannot push you onto an expensive one. Resolution precedence is command override > issue metadata > parent effort metadata > `agents.default` (see `cckit effort`/orchestration docs).",
|
|
88
|
+
"properties": {
|
|
89
|
+
"default": { "type": "string", "description": "Profile name used when nothing more specific resolves. Must name a key of `agents.profiles`; a `default` that names no declared profile is a validation error, not a silent fallback. OMIT IT to get the lowest-tier declared profile, which is the recommended setting: naming an expensive profile here makes every unlabelled issue expensive." },
|
|
90
|
+
"stages": { "type": "array", "items": { "type": "string" }, "description": "Controlled stage vocabulary a profile's `stages` entries are checked against. Replaces the built-in default (build review design docs); an explicit CCKIT_AGENT_STAGES env var wins per invocation." },
|
|
91
|
+
"profiles": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"additionalProperties": true,
|
|
96
|
+
"required": ["kind"],
|
|
97
|
+
"properties": {
|
|
98
|
+
"kind": { "type": "string", "description": "The agent CLI/provider this profile runs, e.g. `claude` or `codex`. Must be a kind the selected runtime can start — the Herdr runtime validates it before any worktree is created." },
|
|
99
|
+
"tier": { "type": "string", "enum": ["low", "mid", "high"], "description": "How much this profile is expected to COST to run, relative to the others. cckit never names a model: the spend posture lives here and the actual flags live in `args`. `low` is assumed when unstated, and the lowest-tier profile is what runs when `agents.default` is not set — so the cheap path is the default by construction rather than by discipline." },
|
|
100
|
+
"args": { "type": "array", "items": { "type": "string" }, "description": "Extra CLI arguments appended to the launch command, as an argv array (never a shell string, so nothing is re-parsed by a shell). The project spells its own flags here — including any model selection — so no vendor CLI syntax and no model id lives in kit code." },
|
|
101
|
+
"permissions": { "type": "string", "description": "Permission/sandbox policy this profile runs under, forwarded to the CLI that implements it. Recorded in the stage receipt so a run's effective policy is auditable after the fact." },
|
|
102
|
+
"stages": { "type": "array", "items": { "type": "string" }, "description": "Stages this profile may run at, each a value from `agents.stages`. A profile selected for a stage it does not list is refused before a worktree or pane exists." },
|
|
103
|
+
"write": { "type": "boolean", "description": "Whether this profile may write to a branch (default false). One writer owns a branch at a time; review profiles stay read-only until ownership is explicitly transferred." },
|
|
104
|
+
"contextBudget": { "type": "integer", "minimum": 0, "description": "Upper bound, in BYTES, on the whole prompt a worker of this profile receives. Whole `## ` sections are dropped from the end of the brief until it fits, and the prompt then names which ones were dropped and how to read them — a truncated brief must read as truncated. Four things are never dropped: the headless framing, the brief's own metadata (worktree, branch, seed freshness, gate command), the truncation notice itself, and the receipt contract. A budget too small to hold those emits them anyway and warns on stderr, because a worker with no receipt contract reports in a shape nothing can parse. Unset, 0, or non-numeric means unbounded. The board and prior conversations are never included at any budget." }
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"description": "Map of profile name to its declaration. Profile names are stable cckit policy referenced by issue and effort metadata; the vendor model id and CLI arguments inside each are project-owned."
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
76
111
|
"captain": {
|
|
77
112
|
"type": "object",
|
|
78
113
|
"additionalProperties": true,
|
|
@@ -139,15 +174,21 @@
|
|
|
139
174
|
},
|
|
140
175
|
"devPorts": {
|
|
141
176
|
"type": "array",
|
|
142
|
-
"description": "Per-app dev PORT lanes. Each entry
|
|
177
|
+
"description": "Per-app dev PORT lanes. Each entry writes PORT = base + <slot> * <devPortStride> into that app's .env.local, so parallel worktrees never fight for a port. <slot> is ALLOCATED and recorded per issue under the git-common-dir (kit-portslots.tsv), not hashed from the issue number: an issue keeps its slot while its worktree exists, and the slot is reclaimed once that worktree is gone. Best-effort: it only takes effect for an app that actually reads the file. `next dev -p ${PORT:-3003}` is expanded by the npm-script shell, which never reads .env.local, so the value is inert for it. cckit does not rely on this — whatever cckit launches itself receives its port explicitly.",
|
|
143
178
|
"items": {
|
|
144
179
|
"type": "object",
|
|
145
180
|
"additionalProperties": true,
|
|
146
181
|
"properties": {
|
|
147
182
|
"path": { "type": "string", "description": "Repo-relative path to the app's .env.local file." },
|
|
148
|
-
"base": { "type": "integer", "description": "Base port for this app's lane." }
|
|
183
|
+
"base": { "type": "integer", "description": "Base port for this app's lane. Every app's base must sit inside ONE devPortStride-wide window (e.g. 3001/3003/3004 with stride 10); a wider spread lets two worktrees' blocks overlap, and cckit warns when it sees one." }
|
|
149
184
|
}
|
|
150
185
|
}
|
|
186
|
+
},
|
|
187
|
+
"devPortStride": {
|
|
188
|
+
"type": "integer",
|
|
189
|
+
"minimum": 1,
|
|
190
|
+
"default": 10,
|
|
191
|
+
"description": "Distance between one worktree's port block and the next (default 10 — room for up to 10 services). It must NOT be the number of services: with stride == count, two bases congruent mod count hand the SAME port to two different worktrees (bases 3001/3003/3004 with count 3 gave worktree slot k+1's admin port to slot k's api). Widen it when a project declares more devPorts entries than the stride, or when its bases span further than one stride."
|
|
151
192
|
}
|
|
152
193
|
}
|
|
153
194
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Verify board selection and failure propagation through a non-git installed copy.
|
|
3
|
+
# errors: strict — fixture failures exit nonzero
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
6
|
+
TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
|
|
7
|
+
mkdir -p "$TMP/install" "$TMP/project" "$TMP/bin"
|
|
8
|
+
cp -R "$ROOT/scripts" "$TMP/install/scripts"
|
|
9
|
+
git -C "$TMP/project" init -q
|
|
10
|
+
printf '%s\n' '{"github":{"repo":"fixture/project","baseBranch":"develop","projectsV2":false}}' > "$TMP/project/cckit.config.json"
|
|
11
|
+
export KIT_CONFIG="$TMP/project/cckit.config.json"
|
|
12
|
+
export FIXTURE_BOARD="$TMP/board.json"
|
|
13
|
+
cat > "$FIXTURE_BOARD" <<'JSON'
|
|
14
|
+
[
|
|
15
|
+
{"number":1,"title":"[Effort] 1 parent","labels":[],"assignees":[]},
|
|
16
|
+
{"number":2,"title":"label parent","labels":[{"name":"effort"}],"assignees":[]},
|
|
17
|
+
{"number":3,"title":"[Effort 1] 1 child","labels":[{"name":"role:tech-lead"}],"assignees":[]},
|
|
18
|
+
{"number":4,"title":"ordinary task","labels":[],"assignees":[]}
|
|
19
|
+
]
|
|
20
|
+
JSON
|
|
21
|
+
cat > "$TMP/bin/gh" <<'STUB'
|
|
22
|
+
#!/usr/bin/env bash
|
|
23
|
+
case "$1 $2" in
|
|
24
|
+
'issue list') [ "${FAIL_BOARD:-0}" = 0 ] || exit 1; cat "$FIXTURE_BOARD" ;;
|
|
25
|
+
'api '*)
|
|
26
|
+
[ "${FAIL_DEPS:-0}" = 0 ] || exit 1
|
|
27
|
+
[ "${BLOCKER_STATE:-}" = '' ] || echo 99
|
|
28
|
+
exit 0 ;;
|
|
29
|
+
'issue view') echo "${BLOCKER_STATE:-OPEN}" ;;
|
|
30
|
+
*) echo "unexpected gh call: $*" >&2; exit 1 ;;
|
|
31
|
+
esac
|
|
32
|
+
STUB
|
|
33
|
+
chmod +x "$TMP/bin/gh"
|
|
34
|
+
export PATH="$TMP/bin:$PATH"
|
|
35
|
+
cd "$TMP/project"
|
|
36
|
+
run() { bash "$TMP/install/scripts/autopilot.sh" --dry-run "$@"; }
|
|
37
|
+
has() { case "$1" in *"$2"*) : ;; *) echo "FAIL missing: $2"; exit 1 ;; esac; }
|
|
38
|
+
fails() { if "$@" > "$TMP/failure" 2>&1; then echo 'FAIL expected nonzero exit'; exit 1; fi; }
|
|
39
|
+
for agent in claude codex; do
|
|
40
|
+
out="$(run --agent "$agent")"
|
|
41
|
+
has "$out" 'would launch 2 flow(s): 3 4'
|
|
42
|
+
has "$out" "agent '$agent'"
|
|
43
|
+
done
|
|
44
|
+
out="$(run --cap 1)"; has "$out" 'would launch 1 flow(s): 3'; has "$out" 'queued past cap (run a later wave): 4'
|
|
45
|
+
out="$(BLOCKER_STATE=CLOSED run 3)"; has "$out" 'would launch 1 flow(s): 3'
|
|
46
|
+
export BLOCKER_STATE=OPEN
|
|
47
|
+
fails run 3
|
|
48
|
+
unset BLOCKER_STATE
|
|
49
|
+
export FAIL_DEPS=1
|
|
50
|
+
fails run 3
|
|
51
|
+
has "$(cat "$TMP/failure")" 'could not read blockers'
|
|
52
|
+
unset FAIL_DEPS
|
|
53
|
+
export FAIL_BOARD=1
|
|
54
|
+
fails run
|
|
55
|
+
has "$(cat "$TMP/failure")" 'could not read the board'
|
|
56
|
+
unset FAIL_BOARD
|
|
57
|
+
printf '%s\n' 'invalid JSON' > "$FIXTURE_BOARD"
|
|
58
|
+
fails run
|
|
59
|
+
has "$(cat "$TMP/failure")" 'invalid board data'
|
|
60
|
+
printf '%s\n' '[]' > "$FIXTURE_BOARD"
|
|
61
|
+
has "$(run 2>&1)" 'nothing open to drive'
|
|
62
|
+
fails run --cap 0 3
|
|
63
|
+
# The agent-facing format remains TOON for multiple rows; raw mode preserves label objects.
|
|
64
|
+
printf '%s\n' '[{"number":3,"title":"a","labels":[{"name":"effort"}],"assignees":[]},{"number":4,"title":"b","labels":[],"assignees":[]}]' > "$FIXTURE_BOARD"
|
|
65
|
+
raw="$(bash "$TMP/install/scripts/task-sync.sh" --raw-json)"
|
|
66
|
+
[ "$(printf '%s' "$raw" | jq -r '.[0].labels[0].name')" = effort ]
|
|
67
|
+
has "$(bash "$TMP/install/scripts/task-sync.sh" --llm)" '[2]{number,title,priority,labels,milestone,assignees,blocked}:'
|
|
68
|
+
echo 'PASS autopilot selection and failures for Claude and Codex launchers'
|
package/scripts/autopilot.sh
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
# cckit autopilot 6 7 8 # drive exactly these issues
|
|
12
12
|
# cckit autopilot --cap 3 # cap concurrent flows (passed through to orchestrate)
|
|
13
13
|
# cckit autopilot --agent codex # drive a different agent CLI
|
|
14
|
+
# cckit autopilot --profile build # drive a declared agent profile (kind + argv)
|
|
15
|
+
# cckit autopilot --runtime herdr # run the selected agents in Herdr
|
|
14
16
|
# cckit autopilot --dry-run # print the plan, launch nothing
|
|
15
17
|
set -euo pipefail
|
|
16
18
|
|
|
@@ -18,17 +20,16 @@ PASS=() # flags forwarded to orchestrate
|
|
|
18
20
|
ISSUES=()
|
|
19
21
|
while [ "$#" -gt 0 ]; do
|
|
20
22
|
case "$1" in
|
|
21
|
-
--cap|--agent) PASS+=("$1" "$2"); shift 2 ;;
|
|
22
|
-
--cap=*|--agent=*|--dry-run|--no-seed|--force|--session=*) PASS+=("$1"); shift ;;
|
|
23
|
-
-h|--help) sed -n '2,
|
|
23
|
+
--cap|--agent|--profile|--runtime) PASS+=("$1" "$2"); shift 2 ;;
|
|
24
|
+
--cap=*|--agent=*|--profile=*|--runtime=*|--dry-run|--no-seed|--force|--session=*) PASS+=("$1"); shift ;;
|
|
25
|
+
-h|--help) sed -n '2,16p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
|
24
26
|
[0-9]*) ISSUES+=("$1"); shift ;;
|
|
25
27
|
*) echo "autopilot: unknown arg '$1'" >&2; exit 2 ;;
|
|
26
28
|
esac
|
|
27
29
|
done
|
|
28
30
|
|
|
29
31
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
30
|
-
ROOT="$(
|
|
31
|
-
[ -n "$ROOT" ] || { echo "autopilot: not in a git repo" >&2; exit 1; }
|
|
32
|
+
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
32
33
|
|
|
33
34
|
# No explicit issues -> auto-select from the board: open issues, minus effort PARENTS (the
|
|
34
35
|
# "[Effort] N ..." umbrella issues that decompose into subs, identified by label:effort OR the
|
|
@@ -36,13 +37,18 @@ ROOT="$(git -C "$SCRIPT_DIR" worktree list --porcelain | awk '/^worktree /{print
|
|
|
36
37
|
# blocked_by gate at launch; this is the coarse pre-filter so the board drives the wave.
|
|
37
38
|
if [ "${#ISSUES[@]}" -eq 0 ]; then
|
|
38
39
|
echo "autopilot: no issues passed - auto-selecting unblocked open issues from the board"
|
|
39
|
-
board="$(bash "$ROOT/scripts/task-sync.sh" --
|
|
40
|
+
board="$(bash "$ROOT/scripts/task-sync.sh" --raw-json)" || {
|
|
41
|
+
echo "autopilot: could not read the board" >&2; exit 1;
|
|
42
|
+
}
|
|
43
|
+
# Capture the parser status before reading rows. Process substitution hides its failures.
|
|
44
|
+
selected="$(printf '%s' "$board" | jq -r '
|
|
45
|
+
if type != "array" then error("expected an issue array") else . end
|
|
46
|
+
| .[]
|
|
47
|
+
| select((any(.labels[]; .name == "effort")) or (.title | test("^\\[Effort\\] ")) | not)
|
|
48
|
+
| .number')" || { echo "autopilot: invalid board data" >&2; exit 1; }
|
|
40
49
|
while IFS= read -r n; do
|
|
41
50
|
[ -n "$n" ] && ISSUES+=("$n")
|
|
42
|
-
done
|
|
43
|
-
.[]
|
|
44
|
-
| select((any(.labels[]; . == "effort")) or (.title | test("^\\[Effort\\] ")) | not)
|
|
45
|
-
| .number')
|
|
51
|
+
done <<< "$selected"
|
|
46
52
|
[ "${#ISSUES[@]}" -ge 1 ] || { echo "autopilot: nothing open to drive" >&2; exit 0; }
|
|
47
53
|
fi
|
|
48
54
|
|
package/scripts/check.sh
CHANGED
|
@@ -58,7 +58,20 @@ if [ -f scripts/lib/secret-guard.sh ]; then
|
|
|
58
58
|
secret_guard_scan || fail=1
|
|
59
59
|
fi
|
|
60
60
|
|
|
61
|
-
# 5.
|
|
61
|
+
# 5. Skill frontmatter context budget. `description` + `when_to_use` are concatenated into the
|
|
62
|
+
# always-loaded skill listing - resident in every session whether or not the skill is invoked.
|
|
63
|
+
# Ratchet, not a hard cap: today's over-budget skills are grandfathered in the baseline file and
|
|
64
|
+
# only *growth* (or a new over-budget skill) fails the gate.
|
|
65
|
+
note "==> skill frontmatter context budget"
|
|
66
|
+
bash scripts/skill-frontmatter-lint.sh || fail=1
|
|
67
|
+
|
|
68
|
+
# 6. Codified review findings. Mechanical defect classes caught in past reviews, encoded as rules
|
|
69
|
+
# in scripts/review-rules.conf so the same bug cannot land twice. Per-file ratchet: today's hits are
|
|
70
|
+
# grandfathered in the baseline, only new or grown hits fail. Rules needing intent stay with review.
|
|
71
|
+
note "==> codified review findings"
|
|
72
|
+
bash scripts/review-lint.sh || fail=1
|
|
73
|
+
|
|
74
|
+
# 7. Behavioral tests - run every *-test.sh through the test runner.
|
|
62
75
|
note "==> behavioral tests"
|
|
63
76
|
bash scripts/test.sh || fail=1
|
|
64
77
|
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
# stop — with no open PRs the captain stops cleanly
|
|
9
9
|
set -u
|
|
10
10
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
11
|
+
# Sealed from the caller's KIT_*/CCKIT_*/EFFORT_* (#369): this suite builds its own fixture.
|
|
12
|
+
# shellcheck source=/dev/null
|
|
13
|
+
. "$ROOT/scripts/lib/test-env.sh" && test_env_seal
|
|
11
14
|
command -v jq >/dev/null 2>&1 || { echo "copilot-loop-test: jq required" >&2; exit 1; }
|
|
12
15
|
fail=0
|
|
13
16
|
ok() { if [ "$1" = "$2" ]; then echo "ok: $3"; else echo "FAIL: $3 -> got '[$1]' want '[$2]'"; fail=1; fi; }
|