lean-agents 0.8.0 → 1.0.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/CHANGELOG.md +407 -0
- package/README.es.md +130 -24
- package/README.md +130 -24
- package/core/copilot-usage-tui.js +5 -2
- package/core/pins.json +18 -9
- package/package.json +3 -2
- package/scripts/behavior-diff.sh +47 -0
- package/scripts/bump-pins.mjs +14 -3
- package/scripts/ci-timing.mjs +61 -0
- package/scripts/labels.sh +1 -0
- package/scripts/lean.mjs +695 -76
- package/scripts/lib/adapters/antigravity.mjs +20 -9
- package/scripts/lib/adapters/claude.mjs +7 -2
- package/scripts/lib/adapters/copilot-cli.mjs +4 -3
- package/scripts/lib/adapters/opencode-v1.mjs +6 -13
- package/scripts/lib/adapters/opencode-v2.mjs +51 -3
- package/scripts/lib/adopt.mjs +172 -27
- package/scripts/lib/agent-lifecycle.mjs +140 -23
- package/scripts/lib/backup-stamp.mjs +25 -0
- package/scripts/lib/doctor.mjs +86 -14
- package/scripts/lib/feedback.mjs +22 -4
- package/scripts/lib/fsops.mjs +42 -14
- package/scripts/lib/inventory.mjs +5 -4
- package/scripts/lib/logins.mjs +28 -0
- package/scripts/lib/network.mjs +53 -13
- package/scripts/lib/opencode-backup.mjs +204 -0
- package/scripts/lib/opencode-upgrade.mjs +441 -0
- package/scripts/lib/opencode1.mjs +203 -0
- package/scripts/lib/parallel.mjs +7 -2
- package/scripts/lib/pins-diff.mjs +33 -0
- package/scripts/lib/pins.mjs +7 -2
- package/scripts/lib/plugin-health.mjs +191 -0
- package/scripts/lib/prereqs.mjs +203 -0
- package/scripts/lib/shell-path.mjs +22 -0
- package/scripts/lib/summary-data.mjs +30 -0
- package/scripts/lib/summary-html.mjs +159 -0
- package/scripts/lib/system.mjs +107 -16
- package/scripts/lib/terminals.mjs +101 -3
- package/scripts/lib/update-plan.mjs +60 -0
- package/scripts/lib/upgrade.mjs +112 -11
- package/scripts/lib/verify-prompt.mjs +46 -0
- package/scripts/pins-latest.mjs +27 -4
- package/scripts/release.mjs +26 -1
- package/scripts/version-watch.mjs +8 -2
package/core/pins.json
CHANGED
|
@@ -10,21 +10,30 @@
|
|
|
10
10
|
"opencode-dcp": { "kind": "npm", "source": "@tarquinen/opencode-dcp", "version": "3.2.0", "verified": "2026-11-05", "ci": "real-opencode-v1", "integrity": "sha512-6tUjeYlbHgMx+0xfB2DiHkknC9G3U5Rk+F4FBsPqAI3vzjaMXGkgsBUNzjL0e5StsEGDmyDTbxtozg6p9mnhng==" },
|
|
11
11
|
"caveman": { "kind": "skill", "source": "JuliusBrussee/caveman", "version": "v4.0.1", "verified": "2026-11-05", "ci": "real-claude", "sha": "d262ab3882952a59312ff3537cd86d894523c5ab" },
|
|
12
12
|
"i-have-adhd": { "kind": "skill", "source": "ayghri/i-have-adhd", "version": "v0.4.1", "verified": "2026-11-05", "ci": "real-tools", "sha": "1ecea1993b7fce257ffbd686c070948b5e07eda6" },
|
|
13
|
-
"lean-update": { "kind": "skill", "source": "estebanmr99/lean-agents", "version": "v0.7.0", "verified": "2026-11-06", "ci": "real-update", "note": "The skill ships in this repo, so
|
|
13
|
+
"lean-update": { "kind": "skill", "source": "estebanmr99/lean-agents", "version": "v0.7.0", "verified": "2026-11-06", "ci": "real-update", "note": "The skill ships in this repo, so a real install needs the pinned tag to exist; real-update checks it." },
|
|
14
14
|
"orca-cli": { "kind": "skill", "source": "stablyai/orca", "version": "v1.4.99", "verified": "2026-11-05", "ci": "real-terminals", "sha": "c36fa1895fb93c0b8989e579a1007ff233d52d6f" },
|
|
15
|
-
"claude-code": { "kind": "npm", "source": "@anthropic-ai/claude-code", "version": "2.1.
|
|
15
|
+
"claude-code": { "kind": "npm", "source": "@anthropic-ai/claude-code", "version": "2.1.316", "verified": "2026-11-14", "node": ">=22.0.0", "ci": "real-claude", "ciOnly": true, "integrity": "sha512-i3BpzyDkcCPnsa0CSkWgxGPs7WMsyqDkxkqT0SDxyEC5XMIxEmcUmluWRHG9VSeBY8Vyv+l9X34JvJ/Bj54nBQ==" },
|
|
16
16
|
"opencode-v1": { "kind": "npm", "source": "opencode-ai", "version": "1.19.0", "verified": "2026-11-05", "ci": "real-opencode-v1", "ciOnly": true, "integrity": "sha512-lddJhFwZI3GLlw8VyOo4yNwBVGeVN/mxH6ORh60h69zAXL7QhjSWY9orj10rwO2kxVnxH9dh45uDCWNuiqPb8A==", "hold": "work PC runs 1.19.0; owner decision 2026-11-10", "note": "OpenCode 1.x only; OpenCode 2 is the opencode-v2 pin." },
|
|
17
17
|
"opencode-v2": { "kind": "npm", "source": "@opencode/cli", "version": "2.2.5", "verified": "2026-11-10", "ci": "real-opencode", "ciOnly": true, "integrity": "sha512-sJAwrwuVa5b+pA3O1UOiSDcC9DgdPVmtkWv6aF6q3+rOiOTCqrE41tkz1kyyE2O8BYPs4eOvBuzkQ6oEm8w5Mw==", "note": "CI installs it with its installer script (checked by SHA256 in tests/ci-downloads.json) and --version. Users install OpenCode 2 themselves." },
|
|
18
18
|
"copilot-cli": { "kind": "npm", "source": "@github/copilot", "version": "1.0.105", "verified": "2026-11-11", "ci": "real-copilot", "ciOnly": true, "integrity": "sha512-k5JPVZrc0Ms4YdAmYS80OGxDvwjDZNVqDS3dxphIFUVSTFJRwcHkbHh3yUKk7MEyBjKqQYKLKNAKSF+dVmjl7A==" },
|
|
19
19
|
"serena": { "kind": "git", "source": "oraios/serena", "version": "v2.1.0", "verified": "2026-11-06", "ci": "real-tools", "sha": "5e4f5cd173c7ff3eed37ee3f1de6c266b937c5dc" },
|
|
20
|
-
"ponytail": { "kind": "npm", "source": "@dietrichgebert/ponytail", "version": "5.3.
|
|
21
|
-
"ponytail-plugin": { "kind": "marketplace", "source": "DietrichGebert/ponytail", "version": "v5.3.
|
|
20
|
+
"ponytail": { "kind": "npm", "source": "@dietrichgebert/ponytail", "version": "5.3.3", "verified": "2026-11-13", "ci": "real-tools", "integrity": "sha512-Gq0ESMi1ZkcY+dvH1dyhOzR3+pYQ/LGW39E4dExcCzhaLe1AMPE43sPrW/JbEiaC986dUWeSzs97WfTABLkdDg==" },
|
|
21
|
+
"ponytail-plugin": { "kind": "marketplace", "source": "DietrichGebert/ponytail", "version": "v5.3.3", "verified": "2026-11-13", "ci": "real-claude", "sha": "7801d061243d7b753bad0e0b3c057cd250b11755" },
|
|
22
22
|
"context-mode-plugin": { "kind": "marketplace", "source": "mksglu/context-mode", "version": "v2.1.4", "verified": "2026-11-06", "ci": "real-claude", "sha": "10a2e677f7605ef8f16dedb37648ead8889addee" },
|
|
23
|
-
"warp-opencode": { "kind": "npm", "source": "@warp-dot-dev/opencode-warp", "version": "0.
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
23
|
+
"warp-opencode": { "kind": "npm", "source": "@warp-dot-dev/opencode-warp", "version": "0.2.0", "verified": "2026-11-14", "ci": "real-terminals", "integrity": "sha512-/0+sNjo45VMJwtIR9rrHWI1Utoyg2CVFfW8pdkr4n5xGu7oavqcIwo6iepOO1knwz384WVGn2vMcyGmcwGp84Q==" },
|
|
24
|
+
"orca-app": { "kind": "download", "source": "stablyai/orca", "version": "1.4.264", "verified": "2026-11-19", "ci": "real-terminals", "sha256": { "windows-x64": "676c32d9eb955a314356a220ffd8afbefc214f0f348a324620628353ad4535f3", "darwin-x64": "c9752fcd27a5367607117c66d3a791b1f2afac311289936229160ce58748aaf8", "darwin-arm64": "1a1eb8039628094377f4194f866e918229d97c11c1918722a30ab5975d679546" }, "url": { "windows-x64": "https://github.com/stablyai/orca/releases/download/v1.4.264/orca-windows-setup.exe", "darwin-x64": "https://github.com/stablyai/orca/releases/download/v1.4.264/orca-macos-x64.dmg", "darwin-arm64": "https://github.com/stablyai/orca/releases/download/v1.4.264/orca-macos-arm64.dmg" } },
|
|
25
|
+
"warp-app": { "kind": "download", "source": "warp.dev", "version": "0.2026.11.04.08.17.stable_01", "verified": "2026-11-19", "ci": "real-windows", "sha256": { "windows-x64": "a50d6082208a195da9e7f2357da4866e7133b937a28ff1962772e7e232986531" }, "url": { "windows-x64": "https://app.warp.dev/download/windows?version=v0.2026.11.04.08.17.stable_01&arch=x86_64" } },
|
|
26
|
+
"bun": { "kind": "download", "source": "oven-sh/bun", "tagPrefix": "bun-", "version": "1.4.4", "verified": "2026-11-10", "ci": "real-bun", "sha256": { "linux-x64": "bf8ccbfb2b0b80159e0f9a6d15c55317add8077534dbc6130a3edb52fccb395c", "linux-aarch64": "baa6bb36f51d6e58561e02bbea825038a9df454f673d6d776e8bbf86f8c7850e", "windows-x64": "cd2c0fccc78f3ede1f50ca827a15f063eda13d4d150a3d0674f4f6e323d864a5", "windows-aarch64": "2d57a0eec0cb44d95c918c3f9734f60455a1306ae5085d76fc68f44e3ee30d09" }, "note": "Release zip checked against the release SHASUMS256.txt before it is extracted (Linux, Windows). macOS uses Homebrew. Bump by hand: copy the new SHASUMS256.txt values. The daily version-watch reports newer releases." },
|
|
27
|
+
"rtk": { "kind": "tool", "source": "rtk-ai/rtk", "via": "brew", "version": "v1.2.0", "min": "v1.2.0", "verified": "2026-11-18", "ci": "real-tools", "sha256": { "linux-x64": "70fee7b4a548c43dde94c77e2335550981b0bc2fb013691d8c8109b5bd0eda37", "linux-aarch64": "f91a06e94e5fad7dfa87946c811a4bcbc500e6da119fd47033f2a8940bf64f93" }, "note": "Installed by Homebrew or winget, which cannot pin a version: the update plan reports installed vs this version and asks for at least `min`; lean-agents never forces one. On Linux without Homebrew the pinned release tarball is downloaded and checked against these hashes. VERIFY: min is the verified release, not a tested floor." },
|
|
28
|
+
"uv": { "kind": "tool", "source": "astral-sh/uv", "via": "brew", "version": "0.13.7", "min": "0.13.7", "verified": "2026-11-18", "ci": "real-tools", "note": "Same as rtk: Homebrew/winget install, reported with a minimum, not forced. Provides uvx for Serena." },
|
|
29
|
+
"jq": { "kind": "tool", "source": "jqlang/jq", "tagPrefix": "jq-", "via": "brew", "version": "1.8.2", "min": "1.8.2", "verified": "2026-11-20", "ci": "real-tools", "note": "Same as rtk: Homebrew/winget install, reported with a minimum, not forced. Required by the Warp plugin for Claude Code. VERIFY: no CI job installs jq yet; formula `jq` and winget id `jqlang.jq` are from upstream (jqlang.org/download, winget-pkgs)." },
|
|
30
|
+
"gh": { "kind": "tool", "source": "cli/cli", "via": "brew", "version": "v2.103.3", "min": "v2.103.3", "verified": "2026-11-18", "ci": "real-tools", "note": "Same as rtk: Homebrew/winget install, reported with a minimum, not forced." },
|
|
31
|
+
"antigravity-cask": { "kind": "cask", "source": "antigravity-cli", "via": "brew-cask", "version": "1.5.11", "verified": "2026-11-18", "ci": "real-antigravity", "note": "Homebrew cask `antigravity-cli` on macOS (#147). Brew cannot install an older cask version or verify a hash from us, so this is the version checked on the date above, reported by the update plan and the daily watch; lean-agents never moves it. Linux uses the antigravity-installer pin." },
|
|
32
|
+
"claude-installer": { "kind": "download", "source": "claude.ai", "url": "https://claude.ai/install.sh", "version": "script", "verified": "2026-11-19", "ci": "real-claude", "sha256": "2c5506d110560bf618bbe88f678f2c2a0047c86a9c6585fc84976120b1de0b44", "note": "Installer for --install-agent claude; it gets the claude-code pin as its version argument." },
|
|
33
|
+
"claude-installer-win": { "kind": "download", "source": "claude.ai", "url": "https://downloads.claude.ai/claude-code-releases/bootstrap.ps1", "version": "script", "verified": "2026-11-19", "ci": "real-windows", "sha256": "cd17c6b555f761d60373659824bf805e1510538226e4c7028e19d7494937a333", "note": "Installer for --install-agent claude on Windows; it downloads and runs claude.exe install <version>." },
|
|
34
|
+
"homebrew-installer": { "kind": "download", "source": "Homebrew/install", "url": "https://raw.githubusercontent.com/Homebrew/install/e5b3c5834e3932c8aaa42deef4794076c9b0cbf0/install.sh", "version": "script", "verified": "2026-11-18", "ci": "release-build", "sha256": "5f333bbe53bc490e51e7ccb1df8779b3dd6ee73a1a7379efda216edb08ccb148", "note": "Official Homebrew installer for install.sh on a Mac without Homebrew, pinned by commit. Read once: needs sudo, clones brew from GitHub, installs the Xcode Command Line Tools via softwareupdate if missing, prints the PATH lines and edits no shell profile. VERIFY: unattended behavior" },
|
|
35
|
+
"opencode-installer": { "kind": "download", "source": "opencode.ai", "url": "https://raw.githubusercontent.com/anomalyco/opencode/1a5b7239bebd9a282ac7df9a693ffe41b8650342/install", "version": "script", "verified": "2026-11-20", "ci": "real-opencode", "sha256": "bbc4584fd6a888bcd14623b8a63afa0f1b4075a2e84a2c3518cd509b446b3135", "note": "Installer for OpenCode 2 (--install-agent opencode-v2 and the CI install); it gets the opencode-v2 pin as --version. Pinned by upstream commit: opencode.ai/v2/install serves the latest `install` from anomalyco/opencode, whose hash moves with every change (2026-11-20). Same file as opencode.ai/v2/install served on 2026-11-10." },
|
|
27
36
|
"antigravity-installer": { "kind": "download", "source": "antigravity.google", "url": "https://antigravity.google/cli/install.sh", "version": "script", "verified": "2026-11-10", "ci": "real-antigravity", "sha256": "62966c07365423bd4dc209355060744058fb30d60f5323e2d360e39de64e5042", "note": "Installer for the Antigravity CLI on Linux." },
|
|
28
|
-
"cursor-installer": { "kind": "download", "source": "cursor.com", "url": "https://cursor.com/install", "version": "script", "verified": "2026-11-
|
|
37
|
+
"cursor-installer": { "kind": "download", "source": "cursor.com", "url": "https://cursor.com/install", "version": "script", "verified": "2026-11-18", "ci": "real-cursor", "sha256": "8ccf20942228a442f840b280acda363b6791798fe692992ac875635b03a8f065", "note": "Installer for the Cursor CLI; the script fixes the CLI version itself." }
|
|
29
38
|
}
|
|
30
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lean-agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Cross-agent, token-efficient AI coding setup.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"scripts/",
|
|
19
19
|
"core/",
|
|
20
|
-
"profiles/"
|
|
20
|
+
"profiles/",
|
|
21
|
+
"CHANGELOG.md"
|
|
21
22
|
],
|
|
22
23
|
"bundleDependencies": true,
|
|
23
24
|
"scripts": {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Local behavior diff (#226): runs the same engine flows at a base ref and at the working tree, each in a throwaway
|
|
3
|
+
# HOME with --no-exec, and diffs the output and the files written (normalized: temp paths, times, hashes). Not a CI job; nothing touches the real HOME.
|
|
4
|
+
# bash scripts/behavior-diff.sh [base-ref] (default: origin/main; exit 1 when anything differs)
|
|
5
|
+
set -eu -o pipefail
|
|
6
|
+
base=${1:-origin/main}
|
|
7
|
+
root=$(cd "$(dirname "$0")/.." && pwd -P)
|
|
8
|
+
tmp=$(cd "$(mktemp -d)" && pwd -P) # -P: macOS /tmp is /private/tmp, and the engine prints real paths
|
|
9
|
+
trap 'git -C "$root" worktree remove --force "$tmp/base" >/dev/null 2>&1 || true; rm -rf "$tmp"' EXIT
|
|
10
|
+
git -C "$root" worktree add --detach -q "$tmp/base" "$base"
|
|
11
|
+
ln -s "$root/node_modules" "$tmp/base/node_modules"
|
|
12
|
+
|
|
13
|
+
# One flow per line: name|step;step;... Every step runs in the same HOME, in order.
|
|
14
|
+
FLOWS='dry-run|--yes --dry-run --agents claude,opencode-v2,copilot-cli,cursor --all-tools --lang en --profile none
|
|
15
|
+
install-doctor-uninstall|--yes --agents claude,opencode-v2 --all-tools --lang en --profile none;--doctor;--yes --uninstall
|
|
16
|
+
opencode1|--yes --agents opencode-v1 --tools dcp,ponytail --lang en --profile none;--doctor
|
|
17
|
+
update|--yes --agents claude --lang en --profile none;--update --yes --dry-run
|
|
18
|
+
adopt|--yes --agents claude,opencode-v2 --lang en --profile none;--adopt;--adopt --json
|
|
19
|
+
upgrade-dry-run|--upgrade-agent opencode --dry-run;--upgrade-agent opencode --dry-run --json
|
|
20
|
+
version|--version'
|
|
21
|
+
|
|
22
|
+
# Temp paths, timestamps and pids differ on every run: normalize them so only behavior shows. <home> <tree>
|
|
23
|
+
norm() {
|
|
24
|
+
sed -e "s#$1#~#g" -e "s#$2#ROOT#g" -e 's/[0-9]\{8\}T[0-9]\{6\}Z/STAMP/g' -e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9:.-]*Z/TIME/g' \
|
|
25
|
+
-e 's/[0-9a-f]\{64\}/SHA/g' -e 's/[0-9]\{13\}/MS/g' -e 's/(node:[0-9]*)/(node:PID)/g'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
run() { # <tree> <out dir>
|
|
29
|
+
mkdir -p "$2"
|
|
30
|
+
printf '%s\n' "$FLOWS" | while IFS='|' read -r name steps; do
|
|
31
|
+
home=$(mktemp -d "$tmp/home.XXXXXX")
|
|
32
|
+
printf '%s\n' "$steps" | tr ';' '\n' | while read -r step; do
|
|
33
|
+
echo "\$ lean $step"
|
|
34
|
+
# shellcheck disable=SC2086 # each step is a list of flags
|
|
35
|
+
(cd "$home" && HOME="$home" USERPROFILE="$home" node "$1/scripts/lean.mjs" --home "$home" --no-exec $step 2>&1) || echo "[exit $?]"
|
|
36
|
+
done | norm "$home" "$1" > "$2/$name.out"
|
|
37
|
+
# A normalized copy of every file written, so the diff shows changed lines, not only changed files.
|
|
38
|
+
(cd "$home" && find . -type f ! -path './.config/lean-agents/backups/*' | while read -r f; do
|
|
39
|
+
t="$2/$name.home/$(printf '%s' "$f" | norm "$home" "$1")"
|
|
40
|
+
mkdir -p "$(dirname "$t")" && norm "$home" "$1" < "$f" > "$t"
|
|
41
|
+
done)
|
|
42
|
+
done
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
run "$tmp/base" "$tmp/a"
|
|
46
|
+
run "$root" "$tmp/b"
|
|
47
|
+
if diff -ru "$tmp/a" "$tmp/b" | sed "s#$tmp/[ab]/##g"; then echo "no behavior change against $base"; else exit 1; fi
|
package/scripts/bump-pins.mjs
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import fs from 'node:fs';
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
7
|
import { isNewer, latestVersion, notesUrl, tagSha } from './version-watch.mjs';
|
|
8
|
+
import { hashUrl, rehash } from './pins-latest.mjs';
|
|
8
9
|
import { compare, minVersion } from './lib/node-runtime.mjs';
|
|
9
10
|
|
|
10
11
|
const FILE = fileURLToPath(new URL('../core/pins.json', import.meta.url));
|
|
@@ -52,11 +53,20 @@ async function checks(p, version, get) {
|
|
|
52
53
|
return extra;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
export async function bump({ text, get, now = Date.now(), today = new Date(now).toISOString().slice(0, 10), log = console.log }) {
|
|
56
|
+
export async function bump({ text, get, hash, now = Date.now(), today = new Date(now).toISOString().slice(0, 10), log = console.log }) {
|
|
56
57
|
const pins = JSON.parse(text).pins;
|
|
57
58
|
const changes = [];
|
|
58
59
|
for (const [key, p] of Object.entries(pins)) {
|
|
59
|
-
|
|
60
|
+
// A fixed-URL installer script has no release date, so no 14-day rule: the new hash is what this green run fetched.
|
|
61
|
+
if (p.version === 'script' && hash) {
|
|
62
|
+
try {
|
|
63
|
+
const m = await rehash(key, p, hash);
|
|
64
|
+
if (m) { text = applyBump(text, key, 'script', today, { sha256: p.sha256 }); changes.push({ ...m, ci: p.ci, notes: p.url, published: '-' }); }
|
|
65
|
+
} catch (e) { log(`! ${key}: ${e.message}`); }
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
// Bun and RTK's sha256 maps are copied by hand; a cask has no release date for the 14-day rule: both are reported by version-watch.
|
|
69
|
+
if (SKIP.has(key) || p.kind === 'download' || p.kind === 'cask' || p.sha256) continue;
|
|
60
70
|
if (p.hold) { log(`held: ${key} ${p.version} (${p.hold})`); continue; }
|
|
61
71
|
try {
|
|
62
72
|
const pick = await pickVersion(p, get, now);
|
|
@@ -85,6 +95,7 @@ export const render = (changes) => [
|
|
|
85
95
|
...changes.map((c) => `| ${c.key} | ${c.from} | ${c.to} | ${nodeCell(c)} | ${c.published} | ${c.notes} | ${c.ci} |`),
|
|
86
96
|
'',
|
|
87
97
|
'Merge only when the `ci` job named for each pin is green for this head commit (VERIFY: the checks come from the workflow dispatch, not from a PR event).',
|
|
98
|
+
...(changes.some((c) => c.published === '-') ? ['', 'A `sha256` row is an installer script at a fixed URL that changed without a version: read the script at that URL before merging.'] : []),
|
|
88
99
|
].join('\n');
|
|
89
100
|
|
|
90
101
|
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
@@ -96,7 +107,7 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href)
|
|
|
96
107
|
if (!r.ok) throw new Error(`${url}: ${r.status}`);
|
|
97
108
|
return r.json();
|
|
98
109
|
};
|
|
99
|
-
const { text, changes } = await bump({ text: fs.readFileSync(FILE, 'utf8'), get });
|
|
110
|
+
const { text, changes } = await bump({ text: fs.readFileSync(FILE, 'utf8'), get, hash: hashUrl });
|
|
100
111
|
if (!changes.length) { console.log('nothing to bump'); process.exit(0); }
|
|
101
112
|
fs.writeFileSync(FILE, text);
|
|
102
113
|
fs.writeFileSync(body, `${render(changes)}\n`);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Wall-clock of recent pull_request ci.yml runs: median and p90, the job that finished last, the jobs that waited longest for a runner.
|
|
2
|
+
// node scripts/ci-timing.mjs [N=30] [--json] (needs `gh` logged in; read-only)
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const min = (a, b) => (new Date(b) - new Date(a)) / 60000;
|
|
7
|
+
const round = (n) => Math.round(n * 10) / 10;
|
|
8
|
+
|
|
9
|
+
function pct(sorted, p) {
|
|
10
|
+
if (!sorted.length) return null;
|
|
11
|
+
return sorted[Math.min(sorted.length - 1, Math.ceil(p * sorted.length) - 1)];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// runs: [{ createdAt, jobs: [{ name, startedAt, completedAt }] }]. Jobs that never started (skipped) are ignored.
|
|
15
|
+
export function summarize(runs) {
|
|
16
|
+
const walls = [];
|
|
17
|
+
const last = {};
|
|
18
|
+
const waits = {};
|
|
19
|
+
for (const r of runs) {
|
|
20
|
+
const jobs = r.jobs.filter((j) => j.startedAt && j.completedAt && !j.startedAt.startsWith('0001'));
|
|
21
|
+
if (!jobs.length) continue;
|
|
22
|
+
const end = jobs.reduce((a, b) => (new Date(b.completedAt) > new Date(a.completedAt) ? b : a));
|
|
23
|
+
walls.push(min(r.createdAt, end.completedAt));
|
|
24
|
+
last[end.name] = (last[end.name] || 0) + 1;
|
|
25
|
+
for (const j of jobs) (waits[j.name] ||= []).push(min(r.createdAt, j.startedAt));
|
|
26
|
+
}
|
|
27
|
+
walls.sort((a, b) => a - b);
|
|
28
|
+
const queue = Object.entries(waits)
|
|
29
|
+
.map(([name, w]) => ({ name, median: round(pct(w.sort((a, b) => a - b), 0.5)), max: round(w[w.length - 1]), runs: w.length }))
|
|
30
|
+
.sort((a, b) => b.median - a.median)
|
|
31
|
+
.slice(0, 5);
|
|
32
|
+
return {
|
|
33
|
+
runs: walls.length,
|
|
34
|
+
median: walls.length ? round(pct(walls, 0.5)) : null,
|
|
35
|
+
p90: walls.length ? round(pct(walls, 0.9)) : null,
|
|
36
|
+
lastJob: Object.entries(last).map(([name, count]) => ({ name, count })).sort((a, b) => b.count - a.count),
|
|
37
|
+
queue,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function collect(exec, n = 30) {
|
|
42
|
+
const gh = (args) => JSON.parse(exec(args));
|
|
43
|
+
const list = gh(['run', 'list', '--workflow', 'ci.yml', '--event', 'pull_request', '--status', 'completed', '--limit', String(n), '--json', 'databaseId,createdAt']);
|
|
44
|
+
return list.map((r) => ({ createdAt: r.createdAt, jobs: gh(['run', 'view', String(r.databaseId), '--json', 'jobs']).jobs }));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function format(s) {
|
|
48
|
+
const lines = [`${s.runs} runs: median ${s.median} min, p90 ${s.p90} min (run created to last job end)`, '', 'last job to finish runs'];
|
|
49
|
+
for (const j of s.lastJob.slice(0, 5)) lines.push(`${j.name.padEnd(36)} ${j.count}`);
|
|
50
|
+
lines.push('', 'queue wait (job start minus run creation) median max');
|
|
51
|
+
for (const q of s.queue) lines.push(`${q.name.padEnd(44)} ${String(q.median).padStart(6)} ${String(q.max).padStart(5)}`);
|
|
52
|
+
return lines.join('\n');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) {
|
|
56
|
+
const args = process.argv.slice(2);
|
|
57
|
+
const n = Number(args.find((a) => /^\d+$/.test(a))) || 30;
|
|
58
|
+
const exec = (a) => execFileSync('gh', a, { encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
|
|
59
|
+
const s = summarize(collect(exec, n));
|
|
60
|
+
console.log(args.includes('--json') ? JSON.stringify(s, null, 2) : format(s));
|
|
61
|
+
}
|
package/scripts/labels.sh
CHANGED
|
@@ -52,4 +52,5 @@ area: ci|5319e7|.github/workflows and tests/real-*
|
|
|
52
52
|
area: docs|5319e7|README, docs/, CHANGELOG
|
|
53
53
|
area: adapters|5319e7|scripts/lib/adapters and per-agent output
|
|
54
54
|
version-watch|ededed|Opened by the daily version watch
|
|
55
|
+
audit|c5def5|Medium+ audit finding; an open one blocks the release workflow
|
|
55
56
|
EOF
|