@jeiemgi/cckit 0.8.0 → 0.10.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 +169 -21
- package/README.md +505 -35
- package/SECURITY.md +5 -0
- package/bin/cckit +189 -20
- package/cckit.config.json +1 -1
- package/commands/kit-doctor.md +13 -5
- package/commands/kit-export-project.md +0 -2
- package/commands/kit-export-training.md +6 -9
- package/commands/kit-init.md +43 -13
- package/commands/kit-routines.md +1 -1
- package/commands/kit-update.md +11 -6
- package/databases/supabase/guide.html +106 -0
- package/databases/supabase/nextjs/lib/supabase/client.ts +9 -0
- package/databases/supabase/nextjs/lib/supabase/server.ts +29 -0
- package/databases/supabase.json +70 -0
- package/integrations/emil-design-eng.json +41 -0
- package/integrations/graft.json +81 -0
- package/integrations/impeccable.json +42 -0
- package/integrations/integration.schema.json +215 -0
- package/integrations/lavish.json +43 -0
- package/integrations/mempalace.json +28 -0
- package/integrations/mlx-lm.json +32 -0
- package/integrations/web-design-guidelines.json +42 -0
- package/kit.config.schema.json +183 -5
- package/package.json +4 -1
- package/profiles/automation.json +7 -1
- package/profiles/content.json +10 -2
- package/profiles/marketing.json +57 -0
- package/profiles/minimal.json +7 -1
- package/profiles/research.json +7 -1
- package/profiles/software.json +7 -1
- package/recipes/nextjs-shadcn.json +49 -0
- package/scripts/agent-skills-external.txt +45 -0
- package/scripts/agent-skills-lint-test.sh +131 -0
- package/scripts/agent-skills-lint.sh +115 -0
- package/scripts/agent-template-lint-test.sh +42 -0
- package/scripts/agent-template-lint.sh +58 -0
- package/scripts/annotate-setup.sh +1 -1
- package/scripts/autopilot-run-test.sh +338 -0
- package/scripts/autopilot-run.sh +448 -0
- package/scripts/autopilot-test.sh +8 -0
- package/scripts/autopilot.sh +10 -1
- package/scripts/benchmark/benchmark-test.sh +85 -0
- package/scripts/benchmark/checkpoint-test.sh +314 -0
- package/scripts/benchmark/checkpoint.sh +408 -0
- package/scripts/benchmark/lib/model.sh +31 -6
- package/scripts/benchmark/report.sh +17 -2
- package/scripts/benchmark/run-quality.sh +36 -10
- package/scripts/benchmark/verb-timings-test.sh +124 -0
- package/scripts/benchmark/verb-timings.sh +149 -0
- package/scripts/check.sh +29 -19
- package/scripts/content-skills-test.sh +144 -0
- package/scripts/copilot-loop-test.sh +25 -0
- package/scripts/database-supabase-test.sh +121 -0
- package/scripts/docs-marketing-words-test.sh +73 -0
- package/scripts/docs-record-tables-test.sh +72 -0
- package/scripts/guard-raw-git-ops-test.sh +8 -0
- package/scripts/hook-adapter-test.sh +193 -0
- package/scripts/init-content-test.sh +225 -0
- package/scripts/init-guided-test.sh +474 -0
- package/scripts/init-recipes-test.sh +104 -0
- package/scripts/init-upgrade-test.sh +341 -2
- package/scripts/init.sh +746 -95
- package/scripts/instruction-budget-baseline.txt +8 -0
- package/scripts/instruction-budget-lint-test.sh +166 -0
- package/scripts/instruction-budget-lint.sh +219 -0
- package/scripts/integrations-check-test.sh +200 -0
- package/scripts/integrations-check.sh +157 -0
- package/scripts/kit-add-test.sh +214 -0
- package/scripts/kit-add.sh +305 -5
- package/scripts/kit-adopt-test.sh +16 -0
- package/scripts/kit-adopt.sh +3 -2
- package/scripts/kit-digest.sh +2 -2
- package/scripts/kit-doctor-test.sh +293 -0
- package/scripts/kit-doctor.sh +272 -140
- package/scripts/kit-export-project-test.sh +3 -3
- package/scripts/kit-remove-test.sh +19 -0
- package/scripts/kit-routines.sh +2 -2
- package/scripts/kit-self-update.sh +1 -1
- package/scripts/kit-version-check-test.sh +4 -0
- package/scripts/kit-version-check.sh +4 -2
- package/scripts/knowledge-lint.sh +4 -4
- package/scripts/leak-fence-test.sh +89 -0
- package/scripts/lib/adapter-select-test.sh +136 -0
- package/scripts/lib/adapter-select.sh +158 -0
- package/scripts/lib/agent-def-test.sh +69 -0
- package/scripts/lib/agent-def.sh +106 -0
- package/scripts/lib/agent-launch-test.sh +212 -0
- package/scripts/lib/agent-launch.sh +335 -0
- package/scripts/lib/board-view-test.sh +11 -0
- package/scripts/lib/board-view.sh +42 -26
- package/scripts/lib/branch-owner-test.sh +26 -0
- package/scripts/lib/branch-owner.sh +16 -9
- package/scripts/lib/captain-test.sh +105 -0
- package/scripts/lib/captain.sh +87 -8
- package/scripts/lib/codex-hooks-test.sh +100 -0
- package/scripts/lib/codex-hooks.sh +69 -0
- package/scripts/lib/commitlint.sh +1 -1
- package/scripts/lib/content-kinds-gc-test.sh +88 -0
- package/scripts/lib/copilot-test.sh +70 -4
- package/scripts/lib/copilot.sh +66 -14
- package/scripts/lib/effort-dispatch-test.sh +3 -3
- package/scripts/lib/effort-metrics-test.sh +178 -1
- package/scripts/lib/effort-metrics.sh +188 -35
- package/scripts/lib/effort-ops-test.sh +217 -7
- package/scripts/lib/effort-ops.sh +281 -49
- package/scripts/lib/effort-parity-test.sh +49 -13
- package/scripts/lib/effort-plan-test.sh +337 -0
- package/scripts/lib/effort-plan.sh +200 -23
- package/scripts/lib/effort-slug.sh +16 -2
- package/scripts/lib/effort.sh +67 -12
- package/scripts/lib/errors-header-test.sh +1 -1
- package/scripts/lib/gh-project-test.sh +35 -1
- package/scripts/lib/gh-project.sh +37 -16
- package/scripts/lib/gh-rest-test.sh +330 -0
- package/scripts/lib/gh-rest.sh +304 -0
- package/scripts/lib/hook-refresh.sh +1 -1
- package/scripts/lib/init-github.sh +412 -0
- package/scripts/lib/init-guide.sh +630 -0
- package/scripts/lib/integration-install-test.sh +343 -0
- package/scripts/lib/integration-install.sh +257 -0
- package/scripts/lib/integrations-test.sh +366 -0
- package/scripts/lib/integrations.sh +244 -0
- package/scripts/lib/kinds-test.sh +125 -0
- package/scripts/lib/kinds.sh +66 -0
- package/scripts/lib/kit-brief-test.sh +22 -3
- package/scripts/lib/kit-brief.sh +45 -5
- package/scripts/lib/kit-config-resolve.sh +2 -2
- package/scripts/lib/kit-config-test.sh +64 -1
- package/scripts/lib/kit-config.sh +37 -1
- package/scripts/lib/kit-events.sh +7 -0
- package/scripts/lib/kit-gc-test.sh +173 -1
- package/scripts/lib/kit-gc.sh +244 -37
- package/scripts/lib/kit-hotfix.sh +216 -0
- package/scripts/lib/kit-interview-test.sh +93 -0
- package/scripts/lib/kit-interview.sh +117 -8
- package/scripts/lib/kit-lib-test.sh +1 -1
- package/scripts/lib/kit-lib.sh +3 -3
- package/scripts/lib/kit-local.sh +2 -2
- package/scripts/lib/kit-manifest.sh +33 -1
- package/scripts/lib/kit-profile-test.sh +3 -3
- package/scripts/lib/kit-status-test.sh +112 -4
- package/scripts/lib/kit-status.sh +246 -16
- package/scripts/lib/kit-task-ops-test.sh +37 -0
- package/scripts/lib/kit-task-ops.sh +362 -89
- package/scripts/lib/kto-hotfix-test.sh +232 -0
- package/scripts/lib/kto-task-close-test.sh +83 -0
- package/scripts/lib/kto-task-new-test.sh +95 -0
- package/scripts/lib/kto-task-pr-merge-test.sh +97 -6
- package/scripts/lib/kto-task-pr-test.sh +70 -0
- package/scripts/lib/leak-fence.sh +89 -0
- package/scripts/lib/light-task-run-test.sh +255 -0
- package/scripts/lib/light-task-test.sh +309 -0
- package/scripts/lib/light-task.sh +706 -0
- package/scripts/lib/next-test.sh +99 -0
- package/scripts/lib/next.sh +9 -3
- package/scripts/lib/orchestration-runtime-test.sh +72 -0
- package/scripts/lib/orchestration-runtime.sh +57 -5
- package/scripts/lib/plan-machine-test.sh +15 -2
- package/scripts/lib/plan-machine.sh +20 -7
- package/scripts/lib/plan-next-test.sh +1 -1
- package/scripts/lib/plan-next.sh +4 -4
- package/scripts/lib/pr-evidence-test.sh +3 -3
- package/scripts/lib/pr-evidence.sh +1 -1
- package/scripts/lib/qa-lane-test.sh +626 -0
- package/scripts/lib/qa-lane.sh +1357 -0
- package/scripts/lib/qa-lanes-test.sh +175 -0
- package/scripts/lib/react-detect.sh +1 -1
- package/scripts/lib/render-test.sh +1 -1
- package/scripts/lib/review-page-test.sh +318 -0
- package/scripts/lib/review-page.sh +369 -0
- package/scripts/lib/review-stage-test.sh +62 -11
- package/scripts/lib/review-stage.sh +42 -60
- package/scripts/lib/role-identity-test.sh +65 -0
- package/scripts/lib/role-identity.sh +25 -2
- package/scripts/lib/secret-guard.sh +3 -3
- package/scripts/lib/session-registry-test.sh +111 -0
- package/scripts/lib/session-registry.sh +233 -0
- package/scripts/lib/stage-receipt-test.sh +14 -1
- package/scripts/lib/stage-receipt.sh +13 -8
- package/scripts/lib/task-source-file.sh +309 -0
- package/scripts/lib/task-source.sh +130 -0
- package/scripts/lib/test-env-test.sh +3 -3
- package/scripts/lib/test-env.sh +7 -4
- package/scripts/lib/upgrade-report-test.sh +120 -0
- package/scripts/lib/upgrade-report.sh +138 -0
- package/scripts/lib/version-bump.sh +3 -3
- package/scripts/lib/wave-result-test.sh +80 -0
- package/scripts/lib/wave-result.sh +127 -0
- package/scripts/lib/worker-brief-test.sh +5 -0
- package/scripts/lib/worker-brief.sh +2 -2
- package/scripts/lib/worktree-issue-test.sh +30 -1
- package/scripts/lib/worktree-issue.sh +93 -9
- package/scripts/lib/worktree-ports-test.sh +57 -4
- package/scripts/lib/worktree-start-test.sh +197 -0
- package/scripts/lib/worktree-start.sh +169 -32
- package/scripts/lib/zsh-safety-test.sh +19 -3
- package/scripts/marketing-walkthrough-test.sh +152 -0
- package/scripts/night-grant-test.sh +37 -0
- package/scripts/night-grant.sh +448 -0
- package/scripts/night-run-test.sh +8 -0
- package/scripts/night-run.mjs +275 -0
- package/scripts/night-run.test.mjs +324 -0
- package/scripts/orchestrate-test.sh +190 -0
- package/scripts/orchestrate.sh +79 -8
- package/scripts/portable-test.sh +11 -2
- package/scripts/publish.sh +28 -3
- package/scripts/review-lint-test.sh +7 -7
- package/scripts/review-lint.sh +2 -2
- package/scripts/review-rules.conf +8 -0
- package/scripts/rule-recipes-test.sh +96 -0
- package/scripts/self-install-test.sh +39 -9
- package/scripts/setup-labels.sh +18 -1
- package/scripts/setup-milestones.sh +1 -1
- package/scripts/showcase.sh +1 -1
- package/scripts/skill-frontmatter-lint-test.sh +4 -4
- package/scripts/skill-frontmatter-lint.sh +1 -1
- package/scripts/status-test.sh +113 -2
- package/scripts/status.sh +16 -3
- package/scripts/task-sync-test.sh +154 -0
- package/scripts/task-sync.sh +243 -32
- package/scripts/test-runner-test.sh +158 -0
- package/scripts/test.sh +131 -23
- package/scripts/update-path-test.sh +279 -0
- package/scripts/ux-ds-audit.sh +1 -1
- package/scripts/ux-graph-scan.sh +6 -6
- package/scripts/wave-worker.sh +54 -0
- package/skills/kit-add/SKILL.md +77 -0
- package/skills/kit-autopilot/SKILL.md +123 -12
- package/skills/kit-cleanup/SKILL.md +5 -2
- package/skills/kit-contribute/SKILL.md +4 -4
- package/skills/kit-docs-writer/SKILL.md +16 -6
- package/skills/kit-effort-close/SKILL.md +17 -8
- package/skills/kit-effort-new/SKILL.md +15 -9
- package/skills/kit-effort-pr/SKILL.md +15 -7
- package/skills/kit-effort-start/SKILL.md +5 -2
- package/skills/kit-gc/SKILL.md +5 -2
- package/skills/kit-next/SKILL.md +5 -1
- package/skills/kit-onboard/SKILL.md +3 -3
- package/skills/kit-page/SKILL.md +93 -0
- package/skills/kit-plan-next/SKILL.md +8 -4
- package/skills/kit-security-sweep/SKILL.md +1 -3
- package/skills/kit-ship/SKILL.md +2 -3
- package/skills/kit-status/SKILL.md +35 -4
- package/skills/kit-task-new/SKILL.md +3 -3
- package/skills/kit-task-pr/SKILL.md +7 -2
- package/skills/kit-task-pr-merge/SKILL.md +7 -2
- package/skills/kit-task-start/SKILL.md +7 -7
- package/skills/kit-task-sync/SKILL.md +19 -3
- package/skills/kit-ux-audit/SKILL.md +3 -2
- package/templates/agents/auto-dev.md +5 -4
- package/templates/agents/backend.md +1 -1
- package/templates/agents/designer.md +2 -0
- package/templates/agents/devops.md +1 -1
- package/templates/agents/editor.md +9 -1
- package/templates/agents/frontend.md +1 -1
- package/templates/agents/local-delegate.md +1 -1
- package/templates/agents/pm.md +5 -5
- package/templates/agents/tech-lead.md +1 -1
- package/templates/benchmarks/SCHEMA.md +9 -3
- package/templates/codex/hooks.json.tmpl +89 -0
- package/templates/hooks/guard-base-branch-commit.sh.tmpl +13 -7
- package/templates/hooks/guard-raw-git-ops.sh.tmpl +27 -14
- package/templates/hooks/mempal_followup.sh.tmpl +2 -2
- package/templates/hooks/mempal_session_start.sh.tmpl +1 -1
- package/templates/hooks/prepush_gate.sh.tmpl +4 -2
- package/templates/hooks/repo-hygiene.sh.tmpl +3 -2
- package/templates/instructions.md.tmpl +174 -0
- package/templates/kit.config.json.tmpl +3 -3
- package/templates/knowledge-INDEX.md.tmpl +1 -1
- package/templates/lib/kit-sigil.sh.tmpl +1 -1
- package/templates/rules/authoring.md +106 -0
- package/templates/rules/branch-naming.md +40 -4
- package/templates/rules/code-retrieval.md +63 -0
- package/templates/rules/delegation-brief.md +0 -3
- package/templates/rules/design-routing.md +3 -3
- package/templates/rules/effort-model.md +14 -10
- package/templates/rules/gate-and-review.md +94 -0
- package/templates/rules/issue-lifecycle.md +88 -0
- package/templates/rules/knowledge-base.md +1 -1
- package/templates/rules/mempalace.md +1 -1
- package/templates/rules/merge-safety.md +108 -0
- package/templates/rules/naming-and-ids.md +23 -17
- package/templates/rules/plain-language.md +59 -0
- package/templates/rules/plan-next.md +9 -11
- package/templates/rules/react-annotate.md +6 -0
- package/templates/rules/review-pages.md +49 -0
- package/templates/rules/risk-tiered-review.md +13 -4
- package/templates/rules/shared-checkout.md +106 -0
- package/templates/rules/skill-gaps.md +2 -7
- package/templates/rules/task-management.md +13 -1
- package/templates/skills/brand-voice/SKILL.md +91 -0
- package/templates/skills/brand-voice/references/voice-template.md +61 -0
- package/templates/skills/campaign/SKILL.md +123 -0
- package/templates/skills/campaign/references/plan-template.md +55 -0
- package/templates/skills/concrete/SKILL.md +2 -2
- package/templates/skills/copywriting/SKILL.md +8 -1
- package/templates/skills/feature-build-refine/SKILL.md +2 -4
- package/templates/skills/morning-briefing/SKILL.md +2 -2
- package/templates/skills/page-design/SKILL.md +145 -0
- package/templates/skills/page-design/add.json +5 -0
- package/templates/skills/page-design/references/design-file-template.md +40 -0
- package/templates/skills/page-design/references/generic-page-patterns.md +43 -0
- package/templates/skills/page-design/references/minimum-rules.md +42 -0
- package/templates/skills/speckit/SKILL.md +4 -5
- package/templates/skills/supabase-patterns/SKILL.md +1 -1
- package/commands/kit-add.md +0 -42
- package/templates/CLAUDE.md.tmpl +0 -106
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# shellcheck shell=bash
|
|
3
|
+
# light-task-test.sh — `cckit task <new|list|next|start|finish|share>` end to end (#450), against a
|
|
4
|
+
# stubbed gh, a throwaway repo and a bare remote. Covers every verb in human and `--llm` form, the
|
|
5
|
+
# derived states (draft → doing → review → done; shared), the move of a draft onto its branch, the pull
|
|
6
|
+
# request `finish` opens (no `Closes`, title ending in the task id), the gc protection of a live
|
|
7
|
+
# `light/<id>-<slug>` branch and its release once the task is done on the base branch, a second
|
|
8
|
+
# clone refused on a task already taken, two branches adding tasks merging without a conflict, and
|
|
9
|
+
# the source interface (an unknown source refused, a second source reached through the dispatcher).
|
|
10
|
+
# Run: bash scripts/lib/light-task-test.sh
|
|
11
|
+
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
12
|
+
set -u
|
|
13
|
+
LIB="$(cd "$(dirname "$0")" && pwd)"
|
|
14
|
+
CCKIT="$(cd "$LIB/../.." && pwd)/bin/cckit"
|
|
15
|
+
# shellcheck source=/dev/null
|
|
16
|
+
. "$LIB/test-env.sh" && test_env_seal
|
|
17
|
+
unset CLAUDE_CODE_REMOTE CCKIT_GH_TRANSPORT
|
|
18
|
+
fail=0
|
|
19
|
+
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
20
|
+
has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> '[$2]' lacks '[$3]'"; fail=1 ;; esac; }
|
|
21
|
+
hasnt() { case "$2" in *"$3"*) echo "FAIL: $1 -> '[$2]' has '[$3]'"; fail=1 ;; *) echo "ok: $1" ;; esac; }
|
|
22
|
+
command -v jq >/dev/null 2>&1 || { echo "light-task-test: jq required" >&2; exit 1; }
|
|
23
|
+
|
|
24
|
+
tmp="$(cd "$(mktemp -d)" && pwd -P)"; trap 'rm -rf "$tmp"' EXIT
|
|
25
|
+
export GH_LOG="$tmp/gh.log" GH_OPEN_URL="" GH_PR_INDEX=""
|
|
26
|
+
: > "$GH_LOG"
|
|
27
|
+
mkdir -p "$tmp/bin"
|
|
28
|
+
# A gh that logs one call per line (newlines in a body become \036). `pr list --head` answers the
|
|
29
|
+
# open-PR lookup; a bare `pr list` answers gc's PR index.
|
|
30
|
+
cat > "$tmp/bin/gh" <<'SH'
|
|
31
|
+
#!/usr/bin/env bash
|
|
32
|
+
{ printf '%s' "$*" | tr '\n' '\036'; echo; } >> "$GH_LOG"
|
|
33
|
+
case "$1 $2" in
|
|
34
|
+
"pr list")
|
|
35
|
+
case " $* " in
|
|
36
|
+
*" --head "*) [ -n "$GH_OPEN_URL" ] && echo "$GH_OPEN_URL" ;;
|
|
37
|
+
*) [ -n "$GH_PR_INDEX" ] && printf '%b' "$GH_PR_INDEX" ;;
|
|
38
|
+
esac ;;
|
|
39
|
+
"pr create") [ -n "${GH_CREATE_FAIL:-}" ] && exit 1; echo "https://github.com/o/r/pull/77" ;;
|
|
40
|
+
"issue view") echo "issue lookups are not expected for a light task" >&2; exit 1 ;;
|
|
41
|
+
*) exit 0 ;;
|
|
42
|
+
esac
|
|
43
|
+
SH
|
|
44
|
+
chmod +x "$tmp/bin/gh"
|
|
45
|
+
export PATH="$tmp/bin:$PATH" KIT_WT_INSTALL=0
|
|
46
|
+
|
|
47
|
+
git init -q --bare "$tmp/remote.git"
|
|
48
|
+
git clone -q "$tmp/remote.git" "$tmp/work" 2>/dev/null
|
|
49
|
+
cd "$tmp/work" || exit 1
|
|
50
|
+
git config user.email t@t; git config user.name t
|
|
51
|
+
cat > cckit.config.json <<'JSON'
|
|
52
|
+
{"kitVersion":"0.0.0","project":{"name":"x","slug":"x","owner":"o","language":"en"},"profile":"p",
|
|
53
|
+
"github":{"repo":"o/r","owner":"o","baseBranch":"develop","projectsV2":false}}
|
|
54
|
+
JSON
|
|
55
|
+
echo "hello" > page.txt
|
|
56
|
+
echo ".claude/worktrees/" > .gitignore
|
|
57
|
+
git add -A; git commit -q -m init; git branch -M develop; git push -q origin develop 2>/dev/null
|
|
58
|
+
W="$tmp/work"
|
|
59
|
+
|
|
60
|
+
# ── new ─────────────────────────────────────────────────────────────────────────────────────────
|
|
61
|
+
out="$("$CCKIT" task new "Write the spring newsletter" 2>&1)"; t "new exits 0" "$?" "0"
|
|
62
|
+
A="$(printf '%s\n' "$out" | sed -n 's/^✓ task \([a-z0-9]*\) .*/\1/p')"
|
|
63
|
+
has "new prints the id and the title" "$out" "✓ task $A · Write the spring newsletter"
|
|
64
|
+
has "new prints the start command" "$out" "cckit task start $A"
|
|
65
|
+
t "new writes one file per task" "$(sed -n 1,3p "tasks/$A.md" | tr '\n' '|')" "id: $A|title: Write the spring newsletter|status: todo|"
|
|
66
|
+
case "$A" in t[0-9a-f][0-9a-f][0-9a-f][0-9a-f]) echo "ok: the id starts with a letter" ;; *) echo "FAIL: id '$A'"; fail=1 ;; esac
|
|
67
|
+
out="$("$CCKIT" task new --priority p1 --body "Two posts" "Plan the launch posts" --llm)"
|
|
68
|
+
B="$(printf '%s' "$out" | jq -r .id)"
|
|
69
|
+
t "new --llm is one JSON object" "$(printf '%s' "$out" | jq -r '[.verb, .ok, .file] | join(" ")')" "task new true tasks/$B.md"
|
|
70
|
+
has "new keeps the body after a blank line" "$(cat "tasks/$B.md")" "created: $(date +%Y-%m-%d)
|
|
71
|
+
|
|
72
|
+
Two posts"
|
|
73
|
+
"$CCKIT" task new >/dev/null 2>&1; t "new without a title is a usage error" "$?" "2"
|
|
74
|
+
"$CCKIT" task new --priority high "x" >/dev/null 2>&1; t "new refuses a priority outside p0-p3" "$?" "2"
|
|
75
|
+
|
|
76
|
+
# ── list / next ─────────────────────────────────────────────────────────────────────────────────
|
|
77
|
+
out="$("$CCKIT" task list 2>&1)"
|
|
78
|
+
t "list shows both drafts" "$(printf '%s\n' "$out" | grep -c ' draft ')" "2"
|
|
79
|
+
t "list orders by priority inside a state" "$(printf '%s\n' "$out" | sed -n 2p | cut -d' ' -f1)" "$B"
|
|
80
|
+
out="$("$CCKIT" task list --llm)"
|
|
81
|
+
t "list --llm is a JSON array of tasks" "$(printf '%s' "$out" | jq -r '[.[] | .id + ":" + .state] | sort | join(",")')" \
|
|
82
|
+
"$(printf '%s\n%s\n' "$A:draft" "$B:draft" | sort | tr '\n' ',' | sed 's/,$//')"
|
|
83
|
+
t "list --llm reports no branch as null" "$(printf '%s' "$out" | jq -r '.[0].branch')" "null"
|
|
84
|
+
out="$("$CCKIT" task next 2>&1)"
|
|
85
|
+
has "next names the highest-priority task" "$out" "next: $B · Plan the launch posts (p1)"
|
|
86
|
+
has "next prints the start command" "$out" "cckit task start $B"
|
|
87
|
+
t "next --llm carries the start command" "$("$CCKIT" task next --llm | jq -r .start)" "cckit task start $B"
|
|
88
|
+
|
|
89
|
+
# ── start ───────────────────────────────────────────────────────────────────────────────────────
|
|
90
|
+
out="$("$CCKIT" task start "$A" 2>"$tmp/start.err")"; t "start exits 0" "$?" "0"
|
|
91
|
+
WT="$W/.claude/worktrees/light+$A-write-the-spring-newsletter"
|
|
92
|
+
BR="light/$A-write-the-spring-newsletter"
|
|
93
|
+
t "start prints worktree|branch|id" "$out" "$WT|$BR|$A"
|
|
94
|
+
t "the worktree is on the task branch" "$(git -C "$WT" rev-parse --abbrev-ref HEAD)" "$BR"
|
|
95
|
+
t "the branch is cut from origin/develop" "$(git -C "$WT" merge-base HEAD origin/develop)" "$(git rev-parse origin/develop)"
|
|
96
|
+
t "the draft is committed on the branch" "$(git -C "$WT" show "HEAD:tasks/$A.md" | sed -n 2p)" "title: Write the spring newsletter"
|
|
97
|
+
[ -f "$W/tasks/$A.md" ] && { echo "FAIL: the draft was left untracked in the starting checkout"; fail=1; } || echo "ok: the draft moved off the starting checkout"
|
|
98
|
+
[ -f "$W/tasks/$B.md" ] && echo "ok: the other draft stays" || { echo "FAIL: start removed another task's draft"; fail=1; }
|
|
99
|
+
t "the branch is pushed" "$(git ls-remote --heads "$tmp/remote.git" "$BR" | grep -c .)" "1"
|
|
100
|
+
has "start says how to finish" "$(cat "$tmp/start.err")" "cckit task finish $A"
|
|
101
|
+
t "list shows the task as doing" "$("$CCKIT" task list --llm | jq -r --arg id "$A" '.[] | select(.id == $id) | .state + " " + .branch')" "doing $BR"
|
|
102
|
+
out="$("$CCKIT" task take "${A%??}" 2>&1 | tail -1)"
|
|
103
|
+
t "take is start, an id prefix resolves, a re-run reuses the worktree" "$out" "$WT|$BR|$A"
|
|
104
|
+
"$CCKIT" task start nope >/dev/null 2>&1; t "start refuses an unknown task" "$?" "1"
|
|
105
|
+
out="$("$CCKIT" task start "$B" --no-push --llm)"
|
|
106
|
+
t "start --llm reports the worktree" "$(printf '%s' "$out" | jq -r '[.verb, .ok, .id, .branch] | join(" ")')" \
|
|
107
|
+
"task start true $B light/$B-plan-the-launch-posts"
|
|
108
|
+
WTB="$(printf '%s' "$out" | jq -r .worktree)"
|
|
109
|
+
t "--no-push leaves the branch local" "$(git ls-remote --heads "$tmp/remote.git" "light/$B-*" | grep -c .)" "0"
|
|
110
|
+
t "the starting checkout is clean again" "$(git -C "$W" status --porcelain)" ""
|
|
111
|
+
|
|
112
|
+
# ── gc protection ───────────────────────────────────────────────────────────────────────────────
|
|
113
|
+
for sh in bash zsh; do
|
|
114
|
+
command -v "$sh" >/dev/null 2>&1 || { echo "skip: $sh not installed"; continue; }
|
|
115
|
+
out="$("$sh" -c '. "$1/worktree-issue.sh"
|
|
116
|
+
printf "%s|" "$(wt_task_id light/t3f9a-spring-news)" "$(wt_task_id /x/.claude/worktrees/light+t3f9a-spring-news)" \
|
|
117
|
+
"$(wt_issue_number light/t3f9a-spring-news)" "$(wt_task_id feat/12-x)" "$(wt_task_id light/12-x)" \
|
|
118
|
+
"$(wt_task_id light/t3f9a)" "$(wt_task_id light/T3-x)" "$(wt_issue_number light/t12a-x)"' _ "$LIB")"
|
|
119
|
+
t "wt_task_id parses the light forms only, and no issue number leaks ($sh)" "$out" "t3f9a|t3f9a|||||||"
|
|
120
|
+
done
|
|
121
|
+
out="$(cd "$W" && . "$LIB/kit-config.sh" && load_kit_config && . "$LIB/kit-gc.sh" && _kit_gc_load_deps \
|
|
122
|
+
&& _kit_gc_classify "$BR" "" o/r; wt_protected_reason "$BR" o/r; echo; wt_protected_reason "$WT" o/r)"
|
|
123
|
+
has "gc classifies a live light branch PROTECTED" "$out" "PROTECTED: light task $A still OPEN"
|
|
124
|
+
has "wt_protected_reason protects the worktree path too" "$(printf '%s\n' "$out" | tail -1)" "light task $A still OPEN"
|
|
125
|
+
out="$("$CCKIT" gc 2>/dev/null)"
|
|
126
|
+
has "cckit gc keeps a started task (no commit beyond base would otherwise read LANDED)" \
|
|
127
|
+
"$(printf '%s\n' "$out" | grep " light/$B-")" "PROTECTED: light task $B still OPEN"
|
|
128
|
+
hasnt "cckit gc offers no light branch for deletion" "$(printf '%s\n' "$out" | grep 'light/')" "> LANDED"
|
|
129
|
+
t "gc never asked GitHub about an issue for a light branch" "$(grep -c '^issue view' "$GH_LOG")" "0"
|
|
130
|
+
out="$(cd "$W" && KIT_TASKS_SOURCE=nosuch bash -c '. "$1/worktree-issue.sh"; wt_task_state t3f9a light/t3f9a-x; wt_protected_reason light/t3f9a-x' _ "$LIB")"
|
|
131
|
+
t "a source that cannot be read is unknown, and unknown is kept" "$out" "unknown
|
|
132
|
+
light task t3f9a state unknown"
|
|
133
|
+
|
|
134
|
+
# ── finish ──────────────────────────────────────────────────────────────────────────────────────
|
|
135
|
+
echo "spring" >> "$WT/page.txt"; echo "draft" > "$WT/new-post.txt"
|
|
136
|
+
: > "$GH_LOG"
|
|
137
|
+
out="$(cd "$WT" && "$CCKIT" task finish "Newsletter copy for the spring issue" 2>"$tmp/fin.err")"; t "finish exits 0" "$?" "0"
|
|
138
|
+
t "finish prints the PR url" "$out" "✓ https://github.com/o/r/pull/77"
|
|
139
|
+
t "the branch copy says done" "$(git -C "$WT" show "HEAD:tasks/$A.md" | sed -n 3p)" "status: done"
|
|
140
|
+
t "the work is committed with the task" "$(git -C "$WT" show --stat --format= HEAD | grep -c 'page.txt')" "1"
|
|
141
|
+
has "a new file is reported, not committed" "$(cat "$tmp/fin.err")" "new-post.txt"
|
|
142
|
+
t "the new file stays untracked without --all" "$(git -C "$WT" ls-files new-post.txt | grep -c .)" "0"
|
|
143
|
+
t "the pushed branch carries the done mark" "$(git --git-dir="$tmp/remote.git" show "$BR:tasks/$A.md" | sed -n 3p)" "status: done"
|
|
144
|
+
create="$(grep '^pr create' "$GH_LOG")"
|
|
145
|
+
has "the PR targets the base branch" "$create" "--base develop --head $BR"
|
|
146
|
+
has "the PR title is a Conventional Commit subject ending in the task id" "$create" "--title feat: Write the spring newsletter [$A]"
|
|
147
|
+
has "the PR body names the task" "$create" "\`$A\` · Write the spring newsletter"
|
|
148
|
+
hasnt "the PR body has no Closes line" "$create" "Closes #"
|
|
149
|
+
t "list shows the task in review" "$("$CCKIT" task list --llm | jq -r --arg id "$A" '.[] | select(.id == $id) | .state')" "review"
|
|
150
|
+
: > "$GH_LOG"
|
|
151
|
+
out="$(GH_OPEN_URL="https://github.com/o/r/pull/77" "$CCKIT" task done "$A" "again" --all --llm)"
|
|
152
|
+
t "done is finish; --llm reports the url" "$(printf '%s' "$out" | jq -r '[.verb, .ok, .url] | join(" ")')" "task finish true https://github.com/o/r/pull/77"
|
|
153
|
+
t "an open PR is reported, not re-created" "$(grep -c '^pr create' "$GH_LOG")" "0"
|
|
154
|
+
t "--all commits new files" "$(git -C "$WT" ls-files new-post.txt | grep -c .)" "1"
|
|
155
|
+
"$CCKIT" task finish "$B" >/dev/null 2>&1; t "finish without a summary is a usage error" "$?" "2"
|
|
156
|
+
"$CCKIT" task finish zz9 "x" >/dev/null 2>&1; t "finish refuses an unknown task" "$?" "1"
|
|
157
|
+
has "the default PR body uses the code wording" "$create" "its diff carries the task record"
|
|
158
|
+
# pr.bodyStyle = content (#418): task B is finished under a config that sets it.
|
|
159
|
+
# plainLanguage.enabled (#420) is set in the same config: the progress lines drop the git words.
|
|
160
|
+
jq '.pr = {bodyStyle: "content"} | .plainLanguage = {enabled: true}' "$W/cckit.config.json" > "$tmp/content.config.json"
|
|
161
|
+
: > "$GH_LOG"
|
|
162
|
+
out="$(cd "$WTB" && KIT_CONFIG="$tmp/content.config.json" "$CCKIT" task finish "fix: launch posts scheduled" 2>"$tmp/fin-plain.err")"
|
|
163
|
+
t "plain language: stdout is still the PR url line" "$out" "✓ https://github.com/o/r/pull/77"
|
|
164
|
+
has "plain language: finish says it is ready for review" "$(cat "$tmp/fin-plain.err")" "[task] ready for review — open the link and approve it there"
|
|
165
|
+
has "the default wording names the worktree" "$(cat "$tmp/start.err")" "created worktree"
|
|
166
|
+
pl="$(KIT_CONFIG="$tmp/content.config.json" "$CCKIT" task new "Plain wording probe" 2>&1)"
|
|
167
|
+
has "plain language: new says where the file is, without 'checkout'" "$pl" "only on this computer until you start it or share the list"
|
|
168
|
+
hasnt "plain language: new does not say checkout" "$pl" "checkout"
|
|
169
|
+
plid="$(printf '%s\n' "$pl" | sed -n 's/^✓ task \([a-z0-9]*\) .*/\1/p')"
|
|
170
|
+
plout="$(KIT_CONFIG="$tmp/content.config.json" "$CCKIT" task start --no-push "$plid" 2>"$tmp/start-plain.err")"; t "plain language: start exits 0" "$?" "0"
|
|
171
|
+
t "plain language: start's stdout keeps the <worktree>|<branch>|<id> shape" "${plout##*|}" "$plid"
|
|
172
|
+
has "plain language: start says the draft is started" "$(cat "$tmp/start-plain.err")" "[$plid] started — the draft lives in "
|
|
173
|
+
has "plain language: start says how to send it for review" "$(cat "$tmp/start-plain.err")" "when the draft is ready for review: cckit task finish $plid \"<summary>\" --all"
|
|
174
|
+
hasnt "the default wording's finish hint does not add --all" "$(cat "$tmp/start.err")" "<summary>\" --all"
|
|
175
|
+
hasnt "plain language: start does not say 'created worktree'" "$(cat "$tmp/start-plain.err")" "created worktree"
|
|
176
|
+
hasnt "plain language: start does not name the branch" "$(cat "$tmp/start-plain.err")" "(branch "
|
|
177
|
+
create="$(grep '^pr create' "$GH_LOG")"
|
|
178
|
+
has "a conventional summary becomes the PR title, with the id" "$create" "--title fix: launch posts scheduled [$B]"
|
|
179
|
+
has "content body: names the task" "$create" "\`$B\` · "
|
|
180
|
+
has "content body: review checklist" "$create" "Read the draft from start to finish"
|
|
181
|
+
has "content body: says what approving does" "$create" "Approving and merging this pull request marks the task done"
|
|
182
|
+
hasnt "content body: no 'diff'" "$create" "diff"
|
|
183
|
+
hasnt "content body: no Closes line" "$create" "Closes #"
|
|
184
|
+
|
|
185
|
+
# ── the PR merges: the task is done, and gc lets the branch go ──────────────────────────────────
|
|
186
|
+
git clone -q "$tmp/remote.git" "$tmp/merger" 2>/dev/null
|
|
187
|
+
( cd "$tmp/merger" && git config user.email t@t && git config user.name t && git checkout -q develop \
|
|
188
|
+
&& git merge -q --squash "origin/$BR" >/dev/null 2>&1 && git commit -q -m "feat: Write the spring newsletter [$A] (#77)" \
|
|
189
|
+
&& git push -q origin develop ) 2>/dev/null
|
|
190
|
+
out="$("$CCKIT" task list --all --llm)"
|
|
191
|
+
t "after the merge the task is done" "$(printf '%s' "$out" | jq -r --arg id "$A" '.[] | select(.id == $id) | .state')" "done"
|
|
192
|
+
t "list without --all hides it" "$("$CCKIT" task list --llm | jq -r --arg id "$A" '[.[] | select(.id == $id)] | length')" "0"
|
|
193
|
+
"$CCKIT" task start "$A" >/dev/null 2>&1; t "start refuses a done task" "$?" "1"
|
|
194
|
+
out="$(cd "$W" && . "$LIB/kit-config.sh" && load_kit_config && . "$LIB/kit-gc.sh" && _kit_gc_load_deps \
|
|
195
|
+
&& wt_task_state "$A" "$BR" && _kit_gc_classify "$BR" "$(printf '%s\tPR#77 MERGED' "$BR")" o/r)"
|
|
196
|
+
has "a done task reads closed" "$out" "closed"
|
|
197
|
+
has "gc offers the branch once its PR merged" "$out" "SAFE (PR#77 MERGED"
|
|
198
|
+
|
|
199
|
+
# ── a second clone: the task is visible, and a taken task is refused ────────────────────────────
|
|
200
|
+
git -C "$WTB" push -q -u origin "light/$B-plan-the-launch-posts" 2>/dev/null
|
|
201
|
+
git clone -q "$tmp/remote.git" "$tmp/mate" 2>/dev/null
|
|
202
|
+
cd "$tmp/mate" || exit 1
|
|
203
|
+
git config user.email m@m; git config user.name m; git checkout -q develop
|
|
204
|
+
t "a teammate's list shows the pushed task in review" "$("$CCKIT" task list --llm | jq -r --arg id "$B" '.[] | select(.id == $id) | .state')" "review"
|
|
205
|
+
out="$("$CCKIT" task start "$B" 2>&1)"; t "a task taken on origin is refused" "$?" "1"
|
|
206
|
+
has "the refusal names the branch and --force" "$out" "cckit task start --force $B"
|
|
207
|
+
out="$("$CCKIT" task start --force "$B" 2>/dev/null)"
|
|
208
|
+
t "--force continues the branch in a worktree here" "$(git -C "${out%%|*}" rev-parse HEAD)" "$(git --git-dir="$tmp/remote.git" rev-parse "light/$B-plan-the-launch-posts")"
|
|
209
|
+
|
|
210
|
+
# ── share ───────────────────────────────────────────────────────────────────────────────────────
|
|
211
|
+
C="$("$CCKIT" task new "Brief the designer" --llm | jq -r .id)"
|
|
212
|
+
D="$("$CCKIT" task new "Book the venue" --llm | jq -r .id)"
|
|
213
|
+
: > "$GH_LOG"
|
|
214
|
+
out="$("$CCKIT" task share "Q1 backlog" 2>/dev/null)"; t "share exits 0" "$?" "0"
|
|
215
|
+
t "share prints the PR url" "$out" "✓ https://github.com/o/r/pull/77"
|
|
216
|
+
SB="$(git for-each-ref --format='%(refname:short)' 'refs/heads/light/share-*')"
|
|
217
|
+
t "the share branch carries both tasks and nothing else" "$(git diff --name-only origin/develop "$SB" | sort | tr '\n' ' ')" \
|
|
218
|
+
"$(printf 'tasks/%s.md\ntasks/%s.md\n' "$C" "$D" | sort | tr '\n' ' ')"
|
|
219
|
+
has "the share PR title counts the tasks" "$(grep '^pr create' "$GH_LOG")" "--title chore(tasks): add 2 tasks [share-"
|
|
220
|
+
t "share leaves the checkout clean" "$(git status --porcelain)" ""
|
|
221
|
+
t "shared tasks stay listed, as shared, on the share branch" "$("$CCKIT" task list --llm | jq -r --arg id "$C" '.[] | select(.id == $id) | .state + " " + .branch')" "shared $SB"
|
|
222
|
+
t "next does not offer a shared task" "$("$CCKIT" task next --llm | jq -r --arg c "$C" --arg d "$D" 'if . == null then "none" elif .id == $c or .id == $d then "shared" else "other" end')" "none"
|
|
223
|
+
out="$("$CCKIT" task start "$C" 2>&1)"; t "start refuses a task whose share PR has not merged" "$?" "1"
|
|
224
|
+
has "the refusal names the share branch" "$out" "share pull request ($SB)"
|
|
225
|
+
[ -d "$tmp/mate/.claude/worktrees/light+$C-brief-the-designer" ] && { echo "FAIL: the refused start left a worktree"; fail=1; } || echo "ok: the refused start made no worktree"
|
|
226
|
+
: > "$GH_LOG"
|
|
227
|
+
out="$(GH_OPEN_URL="https://github.com/o/r/pull/77" "$CCKIT" task share 2>/dev/null)"
|
|
228
|
+
t "share with no new drafts reports the open share PR" "$out" "✓ https://github.com/o/r/pull/77"
|
|
229
|
+
t "and does not create a second one" "$(grep -c '^pr create' "$GH_LOG")" "0"
|
|
230
|
+
# The share PR merges: the tasks are todo, and a share with nothing pending is a no-op.
|
|
231
|
+
( cd "$tmp/merger" && git fetch -q origin && git checkout -q develop && git pull -q origin develop \
|
|
232
|
+
&& git merge -q --squash "origin/$SB" >/dev/null 2>&1 && git commit -q -m "chore(tasks): add 2 tasks (#78)" \
|
|
233
|
+
&& git push -q origin develop ) 2>/dev/null
|
|
234
|
+
t "after the share PR merges the task is todo" "$("$CCKIT" task list --llm | jq -r --arg id "$C" '.[] | select(.id == $id) | .state')" "todo"
|
|
235
|
+
t "share with nothing pending is a no-op" "$("$CCKIT" task share 2>&1)" "(no drafts to share in this checkout)"
|
|
236
|
+
# A share whose pull request could not be opened keeps its tasks listed, and a re-run retries it.
|
|
237
|
+
G="$("$CCKIT" task new "Order the banners" --llm | jq -r .id)"
|
|
238
|
+
out="$(GH_CREATE_FAIL=1 "$CCKIT" task share 2>&1)"; t "share exits 1 when the PR cannot be opened" "$?" "1"
|
|
239
|
+
has "the failure says how to retry" "$out" "run the same command again to retry"
|
|
240
|
+
t "the task of a failed share is still listed" "$("$CCKIT" task list --llm | jq -r --arg id "$G" '.[] | select(.id == $id) | .state')" "shared"
|
|
241
|
+
: > "$GH_LOG"
|
|
242
|
+
out="$("$CCKIT" task share --llm)"
|
|
243
|
+
t "re-running share opens the PR for the pending branch" "$(printf '%s' "$out" | jq -r '[.verb, .ok, .url] | join(" ")')" "task share true https://github.com/o/r/pull/77"
|
|
244
|
+
has "the retried PR lists the pending task" "$(grep '^pr create' "$GH_LOG")" "\`$G\`"
|
|
245
|
+
out="$(cd "$WTB" && GH_CREATE_FAIL=1 "$CCKIT" task finish "fix: launch posts scheduled" 2>&1)"; t "finish exits 1 when the PR cannot be opened" "$?" "1"
|
|
246
|
+
has "finish says the branch is pushed and how to retry" "$out" "the branch is pushed; run the same command again to retry"
|
|
247
|
+
t "the share branch is not a task" "$(. "$LIB/kit-config.sh" && load_kit_config && . "$LIB/worktree-issue.sh" && wt_protected_reason "$SB" o/r)" ""
|
|
248
|
+
|
|
249
|
+
# ── two branches each add a task: the merge is clean ────────────────────────────────────────────
|
|
250
|
+
git checkout -q -b feat/1-a origin/develop
|
|
251
|
+
E="$("$CCKIT" task new "Task on branch a" --llm | jq -r .id)"; git add -A; git commit -q -m "a"
|
|
252
|
+
git checkout -q -b feat/2-b origin/develop
|
|
253
|
+
F="$("$CCKIT" task new "Task on branch b" --llm | jq -r .id)"; git add -A; git commit -q -m "b"
|
|
254
|
+
git merge -q feat/1-a -m "merge a" >/dev/null 2>&1; t "two branches that each add a task merge without a conflict" "$?" "0"
|
|
255
|
+
t "both task files are present after the merge" "$(ls tasks | grep -c -e "^$E.md" -e "^$F.md")" "2"
|
|
256
|
+
|
|
257
|
+
# ── the source interface ────────────────────────────────────────────────────────────────────────
|
|
258
|
+
out="$(KIT_TASKS_SOURCE=monday "$CCKIT" task list 2>&1)"; t "an unknown source is refused" "$?" "1"
|
|
259
|
+
has "the refusal names the file a source lives in" "$out" "scripts/lib/task-source-monday.sh"
|
|
260
|
+
out="$(. "$LIB/task-source.sh"; . "$LIB/worktree-issue.sh"
|
|
261
|
+
task_fake_state() { [ "$1" = t9 ] && echo open; return 0; }
|
|
262
|
+
KIT_TASKS_SOURCE=fake; export KIT_TASKS_SOURCE
|
|
263
|
+
wt_protected_reason light/t9-anything)"
|
|
264
|
+
t "a second source is reached through the dispatcher alone" "$out" "light task t9 still OPEN"
|
|
265
|
+
t "tasks.dir is read from the config" "$(cd "$tmp/mate" && git checkout -q develop 2>/dev/null; jq '.tasks.dir = "work/todo"' cckit.config.json > c.tmp && mv c.tmp cckit.config.json
|
|
266
|
+
id="$("$CCKIT" task new "Elsewhere" --llm | jq -r .id)"; [ -f "work/todo/$id.md" ] && echo yes)" "yes"
|
|
267
|
+
|
|
268
|
+
# ── tasks.default: which list is the project's default (#422) ───────────────────────────────────
|
|
269
|
+
cd "$tmp/mate" || exit 1
|
|
270
|
+
t "task default: issues when the key is absent" "$("$CCKIT" task default)" "issues"
|
|
271
|
+
jq '.tasks.default = "light"' cckit.config.json > c.tmp && mv c.tmp cckit.config.json
|
|
272
|
+
t "task default: light when the config says so" "$("$CCKIT" task default)" "light"
|
|
273
|
+
t "task default --llm" "$("$CCKIT" task default --llm | jq -r '[.verb, .default] | join(" ")')" "task default light"
|
|
274
|
+
want="$(KIT_TASK_FETCH=0 "$CCKIT" task next)"
|
|
275
|
+
t "a bare cckit next answers from the light list" "$(KIT_TASK_FETCH=0 "$CCKIT" next 2>/dev/null)" "$want"
|
|
276
|
+
has "…and names the command that starts the task" "$want" "start: cckit task start "
|
|
277
|
+
t "cckit next --llm is the light task object" "$(KIT_TASK_FETCH=0 "$CCKIT" next --llm 2>/dev/null | jq -r 'has("start")')" "true"
|
|
278
|
+
: > "$GH_LOG"
|
|
279
|
+
KIT_TASK_FETCH=0 "$CCKIT" next >/dev/null 2>&1
|
|
280
|
+
t "the light next makes no gh call" "$(grep -c . "$GH_LOG" | tr -d ' ')" "0"
|
|
281
|
+
jq '.tasks.default = "sometimes"' cckit.config.json > c.tmp && mv c.tmp cckit.config.json
|
|
282
|
+
out="$("$CCKIT" task default 2>"$tmp/default.err")"
|
|
283
|
+
t "an unknown tasks.default reads as issues" "$out" "issues"
|
|
284
|
+
has "…with a warning naming the value" "$(cat "$tmp/default.err")" "tasks.default 'sometimes' is neither 'light' nor 'issues'"
|
|
285
|
+
|
|
286
|
+
# ── #487: a base branch the repository does not have; the `draft` state in plain language ───────
|
|
287
|
+
nb="$tmp/nobase"; mkdir -p "$nb"; cd "$nb" || exit 1
|
|
288
|
+
git init -q; git symbolic-ref HEAD refs/heads/trunk; git config user.email t@t; git config user.name t
|
|
289
|
+
cat > cckit.config.json <<'JSON'
|
|
290
|
+
{"kitVersion":"0.0.0","project":{"name":"x","slug":"x","owner":"o","language":"en"},"profile":"p",
|
|
291
|
+
"github":{"repo":"o/r","owner":"o","baseBranch":"develop","projectsV2":false},"plainLanguage":{"enabled":true}}
|
|
292
|
+
JSON
|
|
293
|
+
echo ".claude/worktrees/" > .gitignore; git add -A; git commit -q -m init
|
|
294
|
+
N="$("$CCKIT" task new "No base yet" --llm | jq -r .id)"
|
|
295
|
+
out="$("$CCKIT" task start "$N" 2>&1)"; t "start without the base branch: rc 1" "$?" "1"
|
|
296
|
+
has "…names the missing branch" "$out" "no base branch 'develop' to cut from"
|
|
297
|
+
has "…names the config key" "$out" "github.baseBranch"
|
|
298
|
+
has "…names the command that creates it" "$out" "cckit init --yes"
|
|
299
|
+
has "…names the branch the folder is on" "$out" "this folder is on 'trunk'"
|
|
300
|
+
t "…and made no worktree" "$([ -e .claude/worktrees ] && echo yes || echo no)" "no"
|
|
301
|
+
out="$(KIT_TASK_FETCH=0 "$CCKIT" task list 2>&1)"
|
|
302
|
+
has "plain language: list still prints the state the source reports" "$out" "$N draft"
|
|
303
|
+
has "plain language: list says what draft means there" "$out" "draft = the task is on this computer only"
|
|
304
|
+
jq 'del(.plainLanguage)' cckit.config.json > c.tmp && mv c.tmp cckit.config.json
|
|
305
|
+
out="$(KIT_TASK_FETCH=0 "$CCKIT" task list 2>&1)"
|
|
306
|
+
case "$out" in *"draft = "*) echo "FAIL: the legend is printed without plain language"; fail=1 ;; *) echo "ok: no legend without plain language" ;; esac
|
|
307
|
+
|
|
308
|
+
[ "$fail" -eq 0 ] && echo "PASS light-task-test" || echo "FAIL light-task-test"
|
|
309
|
+
exit "$fail"
|