@jeiemgi/cckit 0.9.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 +491 -35
- package/SECURITY.md +5 -0
- package/bin/cckit +182 -17
- 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/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 +175 -35
- package/scripts/lib/effort-ops-test.sh +205 -7
- package/scripts/lib/effort-ops.sh +198 -43
- 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.sh +56 -11
- package/scripts/lib/errors-header-test.sh +1 -1
- package/scripts/lib/gh-project-test.sh +35 -1
- package/scripts/lib/gh-project.sh +23 -16
- package/scripts/lib/gh-rest-test.sh +32 -3
- package/scripts/lib/gh-rest.sh +17 -2
- 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 +226 -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 +175 -31
- package/scripts/lib/kto-hotfix-test.sh +232 -0
- package/scripts/lib/kto-task-close-test.sh +1 -1
- package/scripts/lib/kto-task-new-test.sh +95 -0
- package/scripts/lib/kto-task-pr-merge-test.sh +37 -3
- 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/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 +82 -12
- package/scripts/lib/worktree-ports-test.sh +57 -4
- package/scripts/lib/worktree-start-test.sh +197 -0
- package/scripts/lib/worktree-start.sh +153 -31
- 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 +12 -12
- 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,314 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# checkpoint-test.sh — benchmark checkpoints per release and the release gate (#452). Offline: run
|
|
3
|
+
# files are fixtures or the mock backend, and publish.sh only ever runs as a dry run.
|
|
4
|
+
# Run: bash scripts/benchmark/checkpoint-test.sh
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
7
|
+
ROOT="$(cd "$HERE/../.." && pwd)"
|
|
8
|
+
CP="$HERE/checkpoint.sh"
|
|
9
|
+
PUBLISH="$ROOT/scripts/publish.sh"
|
|
10
|
+
|
|
11
|
+
fail=0
|
|
12
|
+
t() { if [ "$2" != "$3" ]; then echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; else echo "ok: $1"; fi; }
|
|
13
|
+
has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> '[$3]' not in '[$2]'"; fail=1 ;; esac; }
|
|
14
|
+
|
|
15
|
+
command -v jq >/dev/null 2>&1 || { echo "SKIP: jq absent"; exit 0; }
|
|
16
|
+
|
|
17
|
+
FIX="$(mktemp -d)"; trap 'rm -rf "$FIX"' EXIT
|
|
18
|
+
|
|
19
|
+
# A project with a benchmarks dir: 4 questions, mock backend answers NONE (1 of 4 right).
|
|
20
|
+
new_project() {
|
|
21
|
+
local d="$1"
|
|
22
|
+
mkdir -p "$d/benchmarks"
|
|
23
|
+
cat > "$d/benchmarks/benchmark.config.json" <<'JSON'
|
|
24
|
+
{ "knowledgeDir": "knowledge",
|
|
25
|
+
"sets": [ {"name":"retrieval","file":"retrieval.jsonl","tier":"retrieval"},
|
|
26
|
+
{"name":"abstain","file":"abstain.jsonl","tier":"abstain"} ] }
|
|
27
|
+
JSON
|
|
28
|
+
printf '%s\n' '{"id":"r1","q":"How do we release?","expect":"releasing.md"}' \
|
|
29
|
+
'{"id":"r2","q":"Branch model?","expect":["branching.md","git.md"]}' \
|
|
30
|
+
'{"id":"r3","q":"Branch | model <x>?","expect":"x.md"}' > "$d/benchmarks/retrieval.jsonl"
|
|
31
|
+
printf '%s\n' '{"id":"a1","q":"DB password?","expect":"NONE"}' > "$d/benchmarks/abstain.jsonl"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# A run as `cckit bench run --json` prints it: <pass> right answers out of <total>.
|
|
35
|
+
mk_run() {
|
|
36
|
+
jq -n --argjson pass "$1" --argjson total "$2" '
|
|
37
|
+
{ kind: "retrieval-run", dry: false, total: $total, pass: $pass, fail: ($total - $pass),
|
|
38
|
+
score_pct: (($pass * 100 / $total) | floor),
|
|
39
|
+
results: [ range(0; $total) | { set: "retrieval.jsonl", tier: "retrieval", id: ("r" + (. + 1 | tostring)),
|
|
40
|
+
got: (if . < $pass then "x.md" else "NONE" end), expect: "x.md",
|
|
41
|
+
pass: (. < $pass), latency_ms: 1000 } ] }'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# A run over named questions: each argument is <id>:<1|0> (answered right or not).
|
|
45
|
+
mk_ids() {
|
|
46
|
+
local a list=""
|
|
47
|
+
for a in "$@"; do list="$list${list:+,}{\"id\":\"${a%%:*}\",\"ok\":${a##*:}}"; done
|
|
48
|
+
jq -n --argjson qs "[$list]" '
|
|
49
|
+
{ kind: "retrieval-run", dry: false, total: ($qs | length), pass: ([ $qs[] | select(.ok == 1) ] | length),
|
|
50
|
+
results: [ $qs[] | { set: "retrieval.jsonl", tier: "retrieval", id: .id,
|
|
51
|
+
got: (if .ok == 1 then "x.md" else "NONE" end), expect: "x.md",
|
|
52
|
+
pass: (.ok == 1), latency_ms: 1000 } ] }'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
P="$FIX/p1"; new_project "$P"
|
|
56
|
+
export BENCH_DIR="$P/benchmarks"
|
|
57
|
+
RUNS="$BENCH_DIR/runs"
|
|
58
|
+
mk_run 2 3 > "$FIX/run-2of3.json"
|
|
59
|
+
mk_run 3 3 > "$FIX/run-3of3.json"
|
|
60
|
+
mk_run 1 3 > "$FIX/run-1of3.json"
|
|
61
|
+
mk_run 5 6 > "$FIX/run-5of6.json"
|
|
62
|
+
mk_run 4 6 > "$FIX/run-4of6.json"
|
|
63
|
+
rec() { bash "$CP" record "$@" --date 2026-01-02 --commit abc1234 --ref develop --model test-model >/dev/null 2>&1; }
|
|
64
|
+
|
|
65
|
+
# ---- 1. record: one file per version, several checkpoints in it -------------
|
|
66
|
+
rec 1.2.0 --from "$FIX/run-2of3.json"; t "record exits 0" "$?" "0"
|
|
67
|
+
t "run file is named after the version" "$([ -f "$RUNS/1.2.0.json" ] && echo yes)" "yes"
|
|
68
|
+
t "file carries schema + version" "$(jq -r '"\(.schema) \(.version)"' "$RUNS/1.2.0.json")" "1 1.2.0"
|
|
69
|
+
t "checkpoint 1 score" "$(jq -r '.checkpoints[0] | "\(.n) \(.pass)/\(.total) \(.score_pct)"' "$RUNS/1.2.0.json")" "1 2/3 66"
|
|
70
|
+
t "checkpoint 1 provenance" "$(jq -r '.checkpoints[0] | "\(.date) \(.ref) \(.commit) \(.model) \(.passes)"' "$RUNS/1.2.0.json")" "2026-01-02 develop abc1234 test-model 1"
|
|
71
|
+
t "checkpoint 1 per-tier score" "$(jq -c '.checkpoints[0].tiers' "$RUNS/1.2.0.json")" '{"retrieval":{"total":3,"pass":2}}'
|
|
72
|
+
t "question text is recorded with the result" "$(jq -r '.checkpoints[0].results[0].q' "$RUNS/1.2.0.json")" "How do we release?"
|
|
73
|
+
rec 1.2.0 --from "$FIX/run-3of3.json" --note "after the fix"
|
|
74
|
+
t "a second checkpoint lands in the same file" "$(jq -r '.checkpoints | length' "$RUNS/1.2.0.json")" "2"
|
|
75
|
+
t "checkpoint 2 is numbered 2" "$(jq -r '.checkpoints[1] | "\(.n) \(.pass)/\(.total) \(.note)"' "$RUNS/1.2.0.json")" "2 3/3 after the fix"
|
|
76
|
+
t "only one run file exists" "$(find "$RUNS" -name '*.json' | wc -l | tr -d ' ')" "1"
|
|
77
|
+
|
|
78
|
+
# ---- 2. several passes are summed ------------------------------------------
|
|
79
|
+
rec 1.3.0 --from "$FIX/run-2of3.json" --from "$FIX/run-3of3.json"
|
|
80
|
+
t "two passes: asked 6, right 5" "$(jq -r '.checkpoints[0] | "\(.passes) \(.questions) \(.pass)/\(.total) \(.score_pct)"' "$RUNS/1.3.0.json")" "2 3 5/6 83"
|
|
81
|
+
t "a question missed in one pass is not a pass" "$(jq -c '.checkpoints[0].results[2] | [.passed,.asked,.pass,.got]' "$RUNS/1.3.0.json")" '[1,2,false,"NONE"]'
|
|
82
|
+
rm -f "$RUNS/1.3.0.json"
|
|
83
|
+
|
|
84
|
+
# ---- 3. record without --from runs the benchmark ---------------------------
|
|
85
|
+
( cd "$P" && BENCH_BACKEND=mock bash "$CP" record 1.3.0 --passes 2 --date 2026-01-03 --commit def5678 --ref develop >/dev/null 2>&1 )
|
|
86
|
+
t "live record, 2 passes over 4 questions" "$(jq -r '.checkpoints[0] | "\(.passes) \(.pass)/\(.total) \(.model)"' "$RUNS/1.3.0.json")" "2 2/8 mock"
|
|
87
|
+
rm -f "$RUNS/1.3.0.json"
|
|
88
|
+
|
|
89
|
+
# ---- 4. refusals that write nothing ----------------------------------------
|
|
90
|
+
before="$(cat "$RUNS/1.2.0.json")"
|
|
91
|
+
bash "$CP" record nightly --from "$FIX/run-3of3.json" >/dev/null 2>&1; t "record refuses a non X.Y.Z version" "$?" "2"
|
|
92
|
+
bash "$CP" record 1.2.0 --from "$FIX/missing.json" >/dev/null 2>&1; t "record refuses a missing run file" "$?" "2"
|
|
93
|
+
jq '.dry = true | .results = []' "$FIX/run-3of3.json" > "$FIX/run-dry.json"
|
|
94
|
+
bash "$CP" record 1.2.0 --from "$FIX/run-dry.json" >/dev/null 2>&1; t "record refuses a --dry run" "$?" "2"
|
|
95
|
+
bash "$CP" record 1.2.0 --passes 0 >/dev/null 2>&1; t "record refuses --passes 0" "$?" "2"
|
|
96
|
+
# An empty answer is what run.sh stores when the model backend failed; it is not a score.
|
|
97
|
+
jq '.results[0].got = ""' "$FIX/run-3of3.json" > "$FIX/run-noanswer.json"
|
|
98
|
+
out="$(bash "$CP" record 1.2.0 --from "$FIX/run-noanswer.json" 2>&1)"; t "record refuses a run with an empty answer" "$?" "2"
|
|
99
|
+
has "the empty-answer refusal says why" "$out" "the model backend returned nothing"
|
|
100
|
+
# A flag given last with no value is a usage error, not an endless parse loop (5 s watchdog).
|
|
101
|
+
for flag in --from --passes --model --commit --ref --date --note --verbs; do
|
|
102
|
+
perl -e 'alarm 5; exec @ARGV' bash "$CP" record 1.2.0 "$flag" >/dev/null 2>&1; t "record: $flag with no value exits 2" "$?" "2"
|
|
103
|
+
done
|
|
104
|
+
perl -e 'alarm 5; exec @ARGV' bash "$CP" page --out >/dev/null 2>&1; t "page: --out with no value exits 2" "$?" "2"
|
|
105
|
+
has "record --help prints the usage" "$(bash "$CP" record --help 2>&1)" "checkpoint.sh record <X.Y.Z>"
|
|
106
|
+
t "a refused record leaves the file unchanged" "$(cat "$RUNS/1.2.0.json")" "$before"
|
|
107
|
+
|
|
108
|
+
# ---- 5. list ---------------------------------------------------------------
|
|
109
|
+
t "list prints one row per checkpoint" "$(bash "$CP" list | wc -l | tr -d ' ')" "2"
|
|
110
|
+
t "list --json drops the per-question results" "$(bash "$CP" list --json | jq -c '[.[] | has("results")] | unique')" "[false]"
|
|
111
|
+
|
|
112
|
+
# ---- 6. check: the gate ----------------------------------------------------
|
|
113
|
+
# 1.2.0 so far: 2/3 then 3/3.
|
|
114
|
+
bash "$CP" check 1.2.0 >/dev/null 2>&1; t "check: higher than the previous checkpoint passes" "$?" "0"
|
|
115
|
+
bash "$CP" check 1.3.0 >/dev/null 2>&1; t "check: missing run file refuses" "$?" "1"
|
|
116
|
+
has "check: missing names the version" "$(bash "$CP" check 1.3.0 2>&1)" "no recorded checkpoint for 1.3.0"
|
|
117
|
+
rec 1.3.0 --from "$FIX/run-3of3.json"
|
|
118
|
+
bash "$CP" check 1.3.0 >/dev/null 2>&1; t "check: equal to the previous version's last checkpoint passes" "$?" "0"
|
|
119
|
+
rec 1.3.0 --from "$FIX/run-2of3.json"
|
|
120
|
+
bash "$CP" check 1.3.0 >/dev/null 2>&1; t "check: lower than the previous checkpoint refuses" "$?" "1"
|
|
121
|
+
out="$(bash "$CP" check 1.3.0 2>&1)"
|
|
122
|
+
has "check: lower names both scores" "$out" "1.3.0 checkpoint 2: 2/3 (66%) is lower than 1.3.0 checkpoint 1: 3/3 (100%)"
|
|
123
|
+
has "check: lower names how many questions were compared" "$out" "on the 3 question(s) both asked (2/3 now, 3/3 before); 0 new, 0 removed"
|
|
124
|
+
has "check: lower names the question that got worse" "$out" "right before, missed now: retrieval.jsonl r3"
|
|
125
|
+
rec 1.3.0 --from "$FIX/run-3of3.json"
|
|
126
|
+
bash "$CP" check 1.3.0 >/dev/null 2>&1; t "check: a later, higher checkpoint clears the refusal" "$?" "0"
|
|
127
|
+
bash "$CP" check 1.2.0 >/dev/null 2>&1; t "check: a later version does not change an earlier verdict" "$?" "0"
|
|
128
|
+
bash "$CP" check bogus >/dev/null 2>&1; t "check: a non X.Y.Z version is a usage error" "$?" "2"
|
|
129
|
+
|
|
130
|
+
# A run file that is not a checkpoint file is named, exit 2: no blank verdict, no empty list or page.
|
|
131
|
+
P5="$FIX/p5"; new_project "$P5"
|
|
132
|
+
cp5() { BENCH_DIR="$P5/benchmarks" bash "$CP" "$@" 2>&1; }
|
|
133
|
+
cp5 record 1.0.0 --from "$FIX/run-3of3.json" >/dev/null
|
|
134
|
+
cp5 page --out "$FIX/p5-page.md" >/dev/null; p5_page="$(cat "$FIX/p5-page.md")"
|
|
135
|
+
printf '{bad' > "$P5/benchmarks/runs/0.9.0.json"
|
|
136
|
+
out="$(cp5 check 1.0.0)"; t "check: an unreadable run file is exit 2" "$?" "2"
|
|
137
|
+
has "check: the unreadable file is named" "$out" "runs/0.9.0.json is not a checkpoint file"
|
|
138
|
+
cp5 list >/dev/null; t "list: an unreadable run file is exit 2" "$?" "2"
|
|
139
|
+
cp5 page >/dev/null; t "page: an unreadable run file is exit 2" "$?" "2"
|
|
140
|
+
cp5 page --out "$FIX/p5-page.md" >/dev/null; t "page --out: an unreadable run file is exit 2" "$?" "2"
|
|
141
|
+
t "page --out: the page on disk is left as it was" "$(cat "$FIX/p5-page.md")" "$p5_page"
|
|
142
|
+
cp5 record 1.0.0 --from "$FIX/run-3of3.json" >/dev/null; t "record: an unreadable run file is exit 2" "$?" "2"
|
|
143
|
+
t "record: nothing was appended" "$(jq '.checkpoints | length' "$P5/benchmarks/runs/1.0.0.json")" "1"
|
|
144
|
+
out="$(KIT_RELEASE_BENCH_DIR="$P5/benchmarks" bash "$PUBLISH" 1.0.0 2>&1)"; t "release: an unreadable run file refuses (exit 1)" "$?" "1"
|
|
145
|
+
has "release: the unreadable file is named" "$out" "is not a checkpoint file"
|
|
146
|
+
|
|
147
|
+
# First version ever recorded has nothing to compare against.
|
|
148
|
+
P2="$FIX/p2"; new_project "$P2"
|
|
149
|
+
BENCH_DIR="$P2/benchmarks" bash "$CP" record 0.1.0 --from "$FIX/run-1of3.json" >/dev/null 2>&1
|
|
150
|
+
BENCH_DIR="$P2/benchmarks" bash "$CP" check 0.1.0 >/dev/null 2>&1; t "check: the first recorded checkpoint passes" "$?" "0"
|
|
151
|
+
|
|
152
|
+
# Versions order numerically (0.10.0 follows 0.9.0). mk_run names its questions r1..rN and answers
|
|
153
|
+
# the first <pass> right, so a 6-question run shares r1..r3 with a 3-question one.
|
|
154
|
+
P3="$FIX/p3"; new_project "$P3"
|
|
155
|
+
cp3() { BENCH_DIR="$P3/benchmarks" bash "$CP" "$@" >/dev/null 2>&1; }
|
|
156
|
+
cp3 record 0.9.0 --from "$FIX/run-2of3.json"
|
|
157
|
+
cp3 record 0.10.0 --from "$FIX/run-4of6.json"
|
|
158
|
+
cp3 check 0.10.0; t "check: 4/6 against 2/3 is 3/3 against 2/3 on the 3 shared questions" "$?" "0"
|
|
159
|
+
cp3 record 0.10.0 --from "$FIX/run-1of3.json"
|
|
160
|
+
cp3 record 0.9.1 --from "$FIX/run-5of6.json"
|
|
161
|
+
cp3 check 0.9.1; t "check: 0.9.1 compares against 0.9.0, not 0.10.0" "$?" "0"
|
|
162
|
+
cp3 check 0.10.0; t "check: 0.10.0 last checkpoint 1/3 is lower than 3/3 on the shared questions" "$?" "1"
|
|
163
|
+
|
|
164
|
+
# ---- 6b. comparison over the questions both checkpoints asked ---------------
|
|
165
|
+
# One project per case: a 3-question checkpoint, then a second one over a changed set.
|
|
166
|
+
cmp_case() { # cmp_case <second run file> [<first run file>] -> prints the verdict, returns check's exit
|
|
167
|
+
# Called in $(…), so the directory is named after the run file and not after a counter.
|
|
168
|
+
local d; d="$FIX/c-$(basename "$1" .json)"; new_project "$d"
|
|
169
|
+
BENCH_DIR="$d/benchmarks" bash "$CP" record 3.0.0 --from "${2:-$FIX/ids-base.json}" >/dev/null 2>&1
|
|
170
|
+
BENCH_DIR="$d/benchmarks" bash "$CP" record 3.0.0 --from "$1" >/dev/null 2>&1
|
|
171
|
+
BENCH_DIR="$d/benchmarks" bash "$CP" check 3.0.0 2>&1
|
|
172
|
+
}
|
|
173
|
+
mk_ids r1:1 r2:1 r3:1 > "$FIX/ids-base.json"
|
|
174
|
+
# Grown set, every shared question still right, one NEW question missed: 5/6 is under 3/3 as a
|
|
175
|
+
# whole-run fraction, and it is not lower.
|
|
176
|
+
mk_ids r1:1 r2:1 r3:1 n1:1 n2:1 n3:0 > "$FIX/ids-grown-ok.json"
|
|
177
|
+
out="$(cmp_case "$FIX/ids-grown-ok.json")"; t "check: grown set, shared questions all still right, passes" "$?" "0"
|
|
178
|
+
has "check: grown set says what was compared" "$out" "3.0.0 checkpoint 2: 5/6 (83%) — not lower than 3.0.0 checkpoint 1: 3/3 (100%) on the 3 question(s) both asked (3/3 now, 3/3 before); 3 new, 0 removed"
|
|
179
|
+
# Grown set, a shared question newly missed: refused although every new question is right.
|
|
180
|
+
mk_ids r1:1 r2:0 r3:1 n1:1 n2:1 n3:1 > "$FIX/ids-grown-low.json"
|
|
181
|
+
out="$(cmp_case "$FIX/ids-grown-low.json")"; t "check: grown set, a shared question newly missed, refuses" "$?" "1"
|
|
182
|
+
has "check: grown-set refusal says what was compared" "$out" "is lower than 3.0.0 checkpoint 1: 3/3 (100%) on the 3 question(s) both asked (2/3 now, 3/3 before); 3 new, 0 removed"
|
|
183
|
+
has "check: grown-set refusal names the question" "$out" "right before, missed now: retrieval.jsonl r2"
|
|
184
|
+
# No question in common: nothing to compare, so the checkpoint is a new baseline.
|
|
185
|
+
mk_ids n1:1 n2:0 > "$FIX/ids-disjoint.json"
|
|
186
|
+
out="$(cmp_case "$FIX/ids-disjoint.json")"; t "check: disjoint sets pass as a new baseline" "$?" "0"
|
|
187
|
+
has "check: a new baseline is named as one" "$out" "3.0.0 checkpoint 2: 1/2 (50%) — new baseline: it shares no question with 3.0.0 checkpoint 1: 3/3 (100%) (2 new, 3 removed)"
|
|
188
|
+
# The same id in another set file is another question.
|
|
189
|
+
jq '.results |= map(.set = "other.jsonl")' "$FIX/ids-base.json" > "$FIX/ids-otherset.json"
|
|
190
|
+
out="$(cmp_case "$FIX/ids-otherset.json")"; t "check: the same ids in another set file share nothing" "$?" "0"
|
|
191
|
+
has "check: another set file is a new baseline" "$out" "new baseline"
|
|
192
|
+
# Removed questions: a missed question that was dropped does not raise or lower the verdict.
|
|
193
|
+
mk_ids r1:1 r2:1 r3:0 > "$FIX/ids-base-miss.json"
|
|
194
|
+
mk_ids r1:1 r2:1 > "$FIX/ids-removed.json"
|
|
195
|
+
out="$(cmp_case "$FIX/ids-removed.json" "$FIX/ids-base-miss.json")"; t "check: removed question, the rest unchanged, passes" "$?" "0"
|
|
196
|
+
has "check: removed questions are counted" "$out" "on the 2 question(s) both asked (2/2 now, 2/2 before); 0 new, 1 removed"
|
|
197
|
+
mk_ids r1:1 r2:0 > "$FIX/ids-removed-low.json"
|
|
198
|
+
out="$(cmp_case "$FIX/ids-removed-low.json")"; t "check: removed question and a remaining one newly missed, refuses" "$?" "1"
|
|
199
|
+
has "check: the removal refusal counts both" "$out" "on the 2 question(s) both asked (1/2 now, 2/2 before); 0 new, 1 removed"
|
|
200
|
+
# The verdict is the score on the shared questions: one newly missed and one newly right is level,
|
|
201
|
+
# and the question that got worse is still named.
|
|
202
|
+
mk_ids r1:0 r2:1 r3:1 > "$FIX/ids-swap.json"
|
|
203
|
+
out="$(cmp_case "$FIX/ids-swap.json" "$FIX/ids-base-miss.json")"; t "check: one newly missed, one newly right, is not lower" "$?" "0"
|
|
204
|
+
has "check: a level score still names the question that got worse" "$out" "right before, missed now: retrieval.jsonl r1"
|
|
205
|
+
# Passes differ: 2 passes over r1..r3 (5 of 6 answers) against 1 pass (3 of 3) is lower.
|
|
206
|
+
d="$FIX/c-passes"; new_project "$d"
|
|
207
|
+
BENCH_DIR="$d/benchmarks" bash "$CP" record 3.0.0 --from "$FIX/ids-base.json" >/dev/null 2>&1
|
|
208
|
+
BENCH_DIR="$d/benchmarks" bash "$CP" record 3.0.0 --from "$FIX/ids-base.json" --from "$FIX/ids-base-miss.json" >/dev/null 2>&1
|
|
209
|
+
out="$(BENCH_DIR="$d/benchmarks" bash "$CP" check 3.0.0 2>&1)"; t "check: a question missed in one of two passes is lower" "$?" "1"
|
|
210
|
+
has "check: passes are counted as answers" "$out" "(5/6 now, 3/3 before)"
|
|
211
|
+
# The release reads the same verdict: a grown set does not refuse it.
|
|
212
|
+
d="$FIX/c-release"; new_project "$d"
|
|
213
|
+
BENCH_DIR="$d/benchmarks" bash "$CP" record 3.0.0 --from "$FIX/ids-base.json" >/dev/null 2>&1
|
|
214
|
+
BENCH_DIR="$d/benchmarks" bash "$CP" record 3.0.0 --from "$FIX/ids-grown-ok.json" >/dev/null 2>&1
|
|
215
|
+
out="$(KIT_RELEASE_BENCH_DIR="$d/benchmarks" bash "$PUBLISH" 3.0.0 2>&1)"; t "release: a grown set with no shared question worse proceeds" "$?" "0"
|
|
216
|
+
has "release: the grown-set comparison is printed" "$out" "3 new, 0 removed"
|
|
217
|
+
|
|
218
|
+
# ---- 7. cckit release (publish.sh) refuses on the same verdict --------------
|
|
219
|
+
# Dry runs only: publish.sh prints its plan and changes nothing.
|
|
220
|
+
rel() { KIT_RELEASE_BENCH_DIR="$1" bash "$PUBLISH" "$2" ${3:+"$3"} 2>&1; }
|
|
221
|
+
out="$(rel "$P/benchmarks" 9.9.9)"; t "release: missing run refuses (exit 1)" "$?" "1"
|
|
222
|
+
has "release: missing run says why" "$out" "no recorded checkpoint for 9.9.9"
|
|
223
|
+
has "release: refusal names the override flag" "$out" "--skip-bench-check"
|
|
224
|
+
case "$out" in *"DRY: "*) rc=1 ;; *) rc=0 ;; esac; t "release: a refusal plans no step" "$rc" "0"
|
|
225
|
+
out="$(rel "$P3/benchmarks" 0.10.0)"; t "release: lower score refuses (exit 1)" "$?" "1"
|
|
226
|
+
has "release: lower score says why" "$out" "is lower than"
|
|
227
|
+
out="$(rel "$P/benchmarks" 1.3.0)"; t "release: higher score proceeds" "$?" "0"
|
|
228
|
+
has "release: higher score reaches the plan" "$out" "DRY: git"
|
|
229
|
+
P4="$FIX/p4"; new_project "$P4"
|
|
230
|
+
BENCH_DIR="$P4/benchmarks" bash "$CP" record 2.0.0 --from "$FIX/run-2of3.json" >/dev/null 2>&1
|
|
231
|
+
BENCH_DIR="$P4/benchmarks" bash "$CP" record 2.0.0 --from "$FIX/run-2of3.json" >/dev/null 2>&1
|
|
232
|
+
out="$(rel "$P4/benchmarks" 2.0.0)"; t "release: equal score proceeds" "$?" "0"
|
|
233
|
+
has "release: equal score prints the comparison" "$out" "not lower than"
|
|
234
|
+
out="$(rel "$P/benchmarks" 9.9.9 --skip-bench-check)"; t "release: override proceeds on a missing run" "$?" "0"
|
|
235
|
+
has "release: override is printed" "$out" "OVERRIDDEN by --skip-bench-check"
|
|
236
|
+
has "release: override still prints the reason" "$out" "no recorded checkpoint for 9.9.9"
|
|
237
|
+
out="$(rel "$P3/benchmarks" 0.10.0 --skip-bench-check)"; t "release: override proceeds on a lower score" "$?" "0"
|
|
238
|
+
has "release: override on a lower score is printed" "$out" "OVERRIDDEN by --skip-bench-check"
|
|
239
|
+
out="$(rel "$P/benchmarks" 1.3.0 --skip-bench-check)"
|
|
240
|
+
case "$out" in *OVERRIDDEN*) rc=1 ;; *) rc=0 ;; esac; t "release: a passing check prints no override" "$rc" "0"
|
|
241
|
+
has "release: a redirected runs dir is printed" "$out" "benchmark runs read from KIT_RELEASE_BENCH_DIR=$P/benchmarks"
|
|
242
|
+
# BENCH_DIR belongs to `cckit bench`; the release reads this repo's own runs whatever it is set to.
|
|
243
|
+
# $P has no 9.9.9 run, so a release that honoured BENCH_DIR would be refused for 9.9.9 from $P.
|
|
244
|
+
own_v="$(basename "$(ls "$ROOT"/benchmarks/runs/*.json | sed -n 1p)" .json)"
|
|
245
|
+
out="$(BENCH_DIR="$FIX/nowhere" bash "$PUBLISH" "$own_v" 2>&1)"
|
|
246
|
+
case "$out" in *"$FIX/nowhere"*) rc=1 ;; *) rc=0 ;; esac; t "release: BENCH_DIR does not move the release check" "$rc" "0"
|
|
247
|
+
has "release: with BENCH_DIR set the check still reads this repo's runs" "$out" "benchmark check: $own_v checkpoint"
|
|
248
|
+
|
|
249
|
+
# ---- 8. the results page is generated from the run files --------------------
|
|
250
|
+
page="$FIX/page.md"
|
|
251
|
+
bash "$CP" page --out "$page" >/dev/null 2>&1; t "page --out writes" "$?" "0"
|
|
252
|
+
has "page: frontmatter title" "$(head -2 "$page")" "title: Benchmark results"
|
|
253
|
+
has "page: newest version first" "$(grep '^## ' "$page" | sed -n 1p)" "## 1.3.0"
|
|
254
|
+
has "page: a checkpoint row with its score" "$(cat "$page")" "| 1 | 2026-01-02 | \`develop@abc1234\` | test-model | 1 | **2/3** (66%)"
|
|
255
|
+
has "page: a missed question is listed, table-safe" "$(cat "$page")" 'Branch \| model <x>?'
|
|
256
|
+
bash "$CP" page --out "$page" --check >/dev/null 2>&1; t "page --check: current" "$?" "0"
|
|
257
|
+
rec 1.3.0 --from "$FIX/run-3of3.json"
|
|
258
|
+
bash "$CP" page --out "$page" --check >/dev/null 2>&1; t "page --check: stale after a new checkpoint" "$?" "1"
|
|
259
|
+
# With `resultsPage` in the config, recording a checkpoint rewrites the page.
|
|
260
|
+
jq '. + {resultsPage: "site/results.md"}' "$BENCH_DIR/benchmark.config.json" > "$FIX/cfg.json" && cp "$FIX/cfg.json" "$BENCH_DIR/benchmark.config.json"
|
|
261
|
+
rec 1.3.0 --from "$FIX/run-3of3.json"
|
|
262
|
+
t "record rewrites the configured page" "$([ -s "$P/site/results.md" ] && echo yes)" "yes"
|
|
263
|
+
bash "$CP" page --check >/dev/null 2>&1; t "page --check reads the configured path" "$?" "0"
|
|
264
|
+
|
|
265
|
+
# ---- 8b. verb timings attached to a checkpoint ------------------------------
|
|
266
|
+
P6="$FIX/p6"; new_project "$P6"
|
|
267
|
+
cp6() { BENCH_DIR="$P6/benchmarks" bash "$CP" "$@" 2>&1; }
|
|
268
|
+
cat > "$FIX/verbs.json" <<'JSON'
|
|
269
|
+
{ "kind": "verb-timings", "date": "2026-01-02", "commit": "abc1234", "runs": 3,
|
|
270
|
+
"verbs": [ { "verb": "status", "runs": 3, "min_ms": 410, "median_ms": 450, "gh_calls": 7, "exit": 0 },
|
|
271
|
+
{ "verb": "effort plan", "runs": 3, "min_ms": 90, "median_ms": 95, "gh_calls": 2, "exit": 1 } ] }
|
|
272
|
+
JSON
|
|
273
|
+
out="$(cp6 record 4.0.0 --from "$FIX/run-3of3.json" --verbs "$FIX/verbs.json" --date 2026-01-02 --commit abc1234 --ref develop --model test-model)"
|
|
274
|
+
t "record --verbs exits 0" "$?" "0"
|
|
275
|
+
has "record --verbs says how many verbs were attached" "$out" "2 verb timings"
|
|
276
|
+
t "the checkpoint carries the verbs" "$(jq -c '.checkpoints[0].verbs[0]' "$P6/benchmarks/runs/4.0.0.json")" '{"verb":"status","runs":3,"min_ms":410,"median_ms":450,"gh_calls":7}'
|
|
277
|
+
t "a non-zero exit is kept with the verb" "$(jq -c '.checkpoints[0].verbs[1].exit' "$P6/benchmarks/runs/4.0.0.json")" "1"
|
|
278
|
+
cp6 record 4.0.0 --from "$FIX/run-3of3.json" >/dev/null
|
|
279
|
+
t "a checkpoint without --verbs has no verbs key" "$(jq -c '.checkpoints[1] | has("verbs")' "$P6/benchmarks/runs/4.0.0.json")" "false"
|
|
280
|
+
cp6 check 4.0.0 >/dev/null; t "check ignores the verbs" "$?" "0"
|
|
281
|
+
p6_page="$(cp6 page)"
|
|
282
|
+
has "page: the verb table header" "$p6_page" "| Verb | Runs | Min ms | Median ms | gh calls |"
|
|
283
|
+
has "page: a verb row" "$p6_page" '| `cckit status` | 3 | 410 | 450 | 7 |'
|
|
284
|
+
has "page: a failed verb shows its exit code" "$p6_page" '| `cckit effort plan` (exit 1) | 3 | 90 | 95 | 2 |'
|
|
285
|
+
t "page: one verb table, for the checkpoint that has one" "$(grep -c 'verb timings' <<<"$p6_page")" "1"
|
|
286
|
+
before="$(cat "$P6/benchmarks/runs/4.0.0.json")"
|
|
287
|
+
cp6 record 4.0.0 --from "$FIX/run-3of3.json" --verbs "$FIX/nope.json" >/dev/null; t "record --verbs refuses a missing file" "$?" "2"
|
|
288
|
+
printf '%s' '{"verbs":[{"verb":"status","runs":3}]}' > "$FIX/verbs-bad.json"
|
|
289
|
+
out="$(cp6 record 4.0.0 --from "$FIX/run-3of3.json" --verbs "$FIX/verbs-bad.json")"; t "record --verbs refuses rows without the timing fields" "$?" "2"
|
|
290
|
+
has "the --verbs refusal says why" "$out" "is not a verb timings file"
|
|
291
|
+
t "a refused --verbs leaves the file unchanged" "$(cat "$P6/benchmarks/runs/4.0.0.json")" "$before"
|
|
292
|
+
|
|
293
|
+
# ---- 9. the verb reaches the script -----------------------------------------
|
|
294
|
+
out="$(cd "$P" && bash "$ROOT/bin/cckit" bench checkpoints 2>&1)"
|
|
295
|
+
has "cckit bench checkpoints lists" "$out" "1.2.0 #1"
|
|
296
|
+
( cd "$P" && bash "$ROOT/bin/cckit" bench check 9.9.9 >/dev/null 2>&1 ); t "cckit bench check exits 1 on a missing run" "$?" "1"
|
|
297
|
+
|
|
298
|
+
# ---- 10. this repo's own record ---------------------------------------------
|
|
299
|
+
unset BENCH_DIR
|
|
300
|
+
own_page="$(jq -r '.resultsPage // empty' "$ROOT/benchmarks/benchmark.config.json")"
|
|
301
|
+
t "this repo names its results page" "$own_page" "docs-site/src/content/docs/benchmark-results.md"
|
|
302
|
+
( cd "$ROOT" && bash "$CP" page --check >/dev/null 2>&1 ); t "the published results page matches benchmarks/runs" "$?" "0"
|
|
303
|
+
bad=0
|
|
304
|
+
for f in "$ROOT"/benchmarks/runs/*.json; do
|
|
305
|
+
[ -e "$f" ] || continue
|
|
306
|
+
v="$(basename "$f" .json)"
|
|
307
|
+
grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' <<<"$v" || { echo " not X.Y.Z: $f"; bad=1; }
|
|
308
|
+
jq -e --arg v "$v" '.schema == 1 and .version == $v and (.checkpoints | length) >= 1
|
|
309
|
+
and ([.checkpoints[].n] == [range(1; (.checkpoints | length) + 1)])' "$f" >/dev/null 2>&1 || { echo " malformed: $f"; bad=1; }
|
|
310
|
+
done
|
|
311
|
+
t "every run file in benchmarks/runs is a well-formed checkpoint file" "$bad" "0"
|
|
312
|
+
|
|
313
|
+
[ "$fail" -eq 0 ] && echo "ALL OK" || echo "SOME FAILED"
|
|
314
|
+
exit "$fail"
|