Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .cursor/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ cd -- "$repo_root"

log() { printf 'cursor-install: %s\n' "$*"; }

# --- Node from .node-version (via nvm) --------------------------------------
node_pin="$(tr -d '[:space:]' <.node-version)"
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
if [[ ! -s "$NVM_DIR/nvm.sh" ]]; then
Expand All @@ -105,7 +104,6 @@ if [[ ! -x "$node_bin_dir/node" ]]; then
exit 1
fi

# --- Make the pinned node win on PATH ---------------------------------------
# Link node/npm/npx into the first writable PATH directory that comes before
# /exec-daemon, whose bundled node would otherwise shadow the pinned one.
link_dir="$(cursor_install::choose_link_dir "$node_bin_dir")"
Expand All @@ -119,7 +117,6 @@ fi

log "node $(node --version) / npm $(npm --version)"

# --- npm dependency roots ---------------------------------------------------
for lock in package-lock.json components/*/package-lock.json distribution/package-lock.json; do
[[ -f "$lock" ]] || continue
dir="$(dirname -- "$lock")"
Expand All @@ -139,12 +136,9 @@ if [[ "$hooks_skipped" == false ]]; then
npm run prepare || log 'npm run prepare failed; git hooks are not installed'
fi

# --- Always-on hygiene engines (Lefthook pre-commit) ------------------------
bin_dir=/usr/local/bin
stamp_dir=/usr/local/share/melodic-cursor

# put_bin <source-path> <dest-name>: install an executable into bin_dir, using
# sudo only when the directory is not directly writable.
put_bin() {
if [[ -w "$bin_dir" ]]; then
install -m 0755 "$1" "$bin_dir/$2"
Expand All @@ -153,7 +147,6 @@ put_bin() {
fi
}

# write_stamp <dest-name> <version>: record the installed version for idempotence.
write_stamp() {
if [[ -w "$stamp_dir" ]] || { [[ ! -e "$stamp_dir" ]] && [[ -w "$(dirname -- "$stamp_dir")" ]]; }; then
mkdir -p "$stamp_dir"
Expand All @@ -164,7 +157,6 @@ write_stamp() {
fi
}

# install_engine <dest> <version> <url> <sha256> <member-in-archive>
install_engine() {
dest="$1"
version="$2"
Expand Down
4 changes: 0 additions & 4 deletions .cursor/install.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ cd "$root" || exit 1
# shellcheck source=.cursor/install.sh
CURSOR_INSTALL_LIBONLY=1 source "$root/.cursor/install.sh"

# --- PATH-link helpers ------------------------------------------------------

scratch="$(mktemp -d)"
trap 'rm -rf "$scratch"' EXIT

Expand Down Expand Up @@ -50,8 +48,6 @@ PATH="$nvm_bin:/exec-daemon:$other_bin:/usr/bin"
found="$(cursor_install::choose_link_dir "$nvm_bin")"
assert_eq 'a writable dir after exec-daemon is not selected' '' "$found"

# --- Engine pin lockstep with ci-workflows ----------------------------------

parse_install_pin() {
local name="$1"
awk -v name="$name" '
Expand Down
4 changes: 0 additions & 4 deletions PSScriptAnalyzerSettings.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
)

Rules = @{
# --- Formatting: OTBS (One True Brace Style) ---

PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $true
Expand Down Expand Up @@ -99,8 +97,6 @@
# a consumer ever needs a floor below the newest syntax-bearing
# PowerShell release.

# --- Best practices ---

PSAvoidUsingCmdletAliases = @{
Enable = $true
AllowList = @()
Expand Down
20 changes: 0 additions & 20 deletions components/claude-lanes/repin-callers.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ for tool in git sed grep sort paste cmp jq; do
fail 'required tool present' "$tool is missing; this environment cannot run the subject"
done

# ---------------------------------------------------------------- gh stubbing

# stub_gh <dir> — a `gh` that answers the four endpoints repin::resolve calls,
# driven entirely by STUB_* variables the caller exports. It reproduces gh's
# real 404 shape (`gh: Not Found (HTTP 404)` on stderr, non-zero exit) because
Expand Down Expand Up @@ -167,8 +165,6 @@ run_resolve() {
PATH="$stub_bin:$PATH" GITHUB_OUTPUT="$outfile" bash "$script" resolve "$upstream" 2>&1
}

# ------------------------------------------------------------ resolve: shapes

# Lightweight tag — the shape ci-workflows cuts today. The ref points straight
# at the commit, so no second dereference happens.
out_file="$scratch/out-lightweight"
Expand Down Expand Up @@ -216,8 +212,6 @@ assert_contains 'resolve: annotated tag dereferences to the commit' "$(cat "$out
assert_not_contains 'resolve: annotated tag never emits the tag object SHA' "$(cat "$out_file")" "$tag_object"
unset STUB_TAG_OBJECT_SHA

# ------------------------------------------- resolve: highest SemVer wins

# THE SOURCE-OF-TRUTH RULE. The subject picks the highest-SemVer published
# release, not the first entry and not the one the `releases/latest` endpoint
# would name. `releases/latest` orders by `created_at`, which GitHub sets from
Expand Down Expand Up @@ -267,8 +261,6 @@ assert_contains 'resolve: an empty release set is a notice' "$out" '::notice::'
assert_not_contains 'resolve: an empty release set raises no error' "$out" '::error::'
unset STUB_RELEASE_TAGS

# ------------------------------------------------- resolve: 404 vs 404

# Benign: the repository reads, it simply has no published release. A clean
# no-op, because there is nothing to re-pin against yet. Under the LIST
# endpoint that case is 200 with an empty body — not the 404 the old
Expand Down Expand Up @@ -334,8 +326,6 @@ rc=0
out="$(PATH="$stub_bin:$PATH" GITHUB_OUTPUT='' bash "$script" resolve "$upstream" 2>&1)" || rc=$?
assert_nonzero 'resolve: missing GITHUB_OUTPUT fails' "$rc"

# ------------------------------------------------------------- apply: fixtures

# commit_all <dir> <message> — stage everything and commit, ignoring ambient
# signing and hooks the way make_repo does.
commit_all() {
Expand Down Expand Up @@ -399,8 +389,6 @@ run_apply() {
bash "$script" apply "$tag" "$sha" "$release_date" 2>&1)
}

# ------------------------------------------- apply: rewrite scope + major jump

repo="$scratch/repo-major"
lane_repo "$repo" "$old_sha" 'v0.9.1'
out_file="$scratch/out-apply-major"
Expand Down Expand Up @@ -515,8 +503,6 @@ assert_contains 'apply: mixed-SHA extras include the fleet guard caller componen
"$guard_fleet_caller"
unset STUB_COMPARE_STATUS

# ------------------------------------------ apply: a pin ahead of the release

# guard_repo <dir> <guard-date> <message> — a lane_repo plus the three
# .github/workflows extras at the old tag-form pin and both guard callers at a
# fallback-form pin dated <guard-date>, with the hosted lanes, committed.
Expand Down Expand Up @@ -685,8 +671,6 @@ assert_contains 'narrowing: an @main reusable is untouched' "$(cat "$repo/.githu
assert_eq 'narrowing: a caller with only a SHA-pinned reusable stays byte-identical' \
"$(git -C "$repo" diff --name-only -- components/claude-lanes-hosted/reusable-only.yml)" ''

# ------------------------------------------------- apply: same major, no diff

repo="$scratch/repo-minor"
lane_repo "$repo" "$old_sha" 'v0.9.1'
out_file="$scratch/out-apply-minor"
Expand All @@ -710,8 +694,6 @@ assert_not_contains 'apply: no-diff run never reports a change' "$(cat "$out_fil
assert_contains 'apply: no-diff run is a notice' "$out" '::notice::'
assert_silent 'apply: no-diff run leaves the tree clean' "$(git -C "$repo" status --porcelain)"

# ------------------------------------------------------------ apply: controls

# A repository with no lane callers must fail rather than report a clean no-op
# — silently re-pinning nothing is how this job would rot after a rename.
repo="$scratch/repo-empty"
Expand Down Expand Up @@ -773,8 +755,6 @@ out="$(GITHUB_OUTPUT="$scratch/out-usage" bash "$script" apply v1.0.0 "$new_sha"
assert_nonzero 'apply without the release date is a usage error' "$rc"
assert_contains 'apply usage names the date argument' "$out" '<date>'

# ------------------------------------------- apply: only the paths a release changed

# consumer_repo <dir>: a consumer-shaped checkout whose callers live under
# .github/ alone: two reusable workflows still SHA-pinned (never moved; they
# float on @main), one composite carrying two action pins, plus a pin-shaped
Expand Down
10 changes: 0 additions & 10 deletions components/cloud-environment/pages-publish
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ else
[[ -z "$page_id" || "$page_id" =~ $id_re ]] || usage "invalid id '$page_id'"
fi

# ---------------------------------------------------------------- config

declare -A cfg=()
keys=(PUBLIC_ENDPOINT PRIVATE_ENDPOINT PUBLIC_TOKEN_SECRET PRIVATE_TOKEN_SECRET
PRIVATE_ACCESS_ID_SECRET PRIVATE_ACCESS_KEY_SECRET)
Expand Down Expand Up @@ -133,8 +131,6 @@ load_config() {

load_config

# ---------------------------------------------------------------- upload

# send <visibility> <method> <path> [<file>]: one request to that visibility's
# upload origin. Sets status and body. The bearer token, and for the private
# origin the Access service-token pair, are resolved by vault-exec into the
Expand Down Expand Up @@ -187,16 +183,12 @@ if [[ -n "$delete_id" ]]; then
exit 0
fi

# ---------------------------------------------------------------- input

tmp_root="$(realpath -e -- "${TMPDIR:-/tmp}" 2>/dev/null)" || die 3 "temp dir ${TMPDIR:-/tmp} does not exist"
real="$(realpath -e -- "$file" 2>/dev/null)" || die 3 "$file does not exist"
[[ -f "$real" && "$real" == "$tmp_root"/* ]] || die 3 "$file is not a regular file under $tmp_root"
stamp_re='<!-- rv-gen:[A-Za-z0-9._-]+ sha256:[0-9a-f]{64} -->'
grep -aqE -- "$stamp_re" "$real" || die 3 "$file carries no builder stamp <!-- rv-gen:<name> sha256:<64 hex> -->"

# ---------------------------------------------------------------- scan

# A copy of the shapes in claude-code-plugins lib/publish-gate.mjs and the
# upload Worker's scan.js; change all three together. Only these shapes are
# caught, and the Worker's scan is the binding one. The builder stamp is
Expand Down Expand Up @@ -397,8 +389,6 @@ if [[ -n "$reason" ]]; then
fi
[[ "$sent" == "$visibility" ]] || page_id=''

# ---------------------------------------------------------------- publish

send "$sent" PUT "/_upload${page_id:+/$page_id}" "$real"
if [[ "$status" == 409 && "$sent" == public && "$body" == private-required ]]; then
printf 'pages-publish: the public host requires private; creating a private page\n' >&2
Expand Down
1 change: 0 additions & 1 deletion components/code-review-rules/code-review-rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ if [[ "$command" == file ]]; then
exit 0
fi

# ---- fleet ---------------------------------------------------------------
scratch="$(mktemp -d)"
trap 'rm -rf "$scratch"' EXIT

Expand Down
4 changes: 0 additions & 4 deletions components/code-review-rules/code-review-rules.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ repo nested-fence "$(
printf '%s`\n' "$fence"
)" review

# --- file ------------------------------------------------------------------
# check_file <fixture repo> — `file` mode over one fixture, stderr merged.
check_file() { bash "$script" file --root "$work/fleet/$1" 2>&1; }

Expand Down Expand Up @@ -141,7 +140,6 @@ out="$(check_file nested-fence)"
assert_exit 'a shorter fence inside a four-backtick fence does not close it' 1 $?
assert_contains 'a section inside the longer fence does not count' "$out" "no '## Code Review Rules' heading"

# --- fleet -----------------------------------------------------------------
printf '%s\n' synced remote >"$work/ok.txt"
out="$(bash "$script" fleet --repos "$work/ok.txt" --fixtures "$work/fleet" 2>&1)"
assert_exit 'fleet passes when every repo conforms' 0 $?
Expand All @@ -155,7 +153,6 @@ assert_contains 'fleet names a repo with the wrong pointer' "$out" 'MISSING: wro
assert_contains 'fleet names a repo with a duplicate pointer' "$out" 'MISSING: duplicate-stale: 2 org-wide criteria pointer lines'
assert_contains 'fleet still lists the conforming repo' "$out" 'OK: synced'

# --- names -----------------------------------------------------------------
# The listing filter both fleet listings apply, over repository objects shaped
# like the GitHub API's: sandbox anywhere in the topics, archived, and absent
# or null topics.
Expand All @@ -174,7 +171,6 @@ assert_eq 'names keeps only audited repositories' "$(printf '%s\n' kept no-topic
out="$(printf '%s\n' "$listing" | jq -c '.[]' | bash "$script" names 2>&1)"
assert_eq 'names reads a stream of objects, as gh --jq emits' "$(printf '%s\n' kept no-topics null-topics sandboxed-word)" "$out"

# --- usage -----------------------------------------------------------------
bash "$script" bogus >/dev/null 2>&1
assert_exit 'an unknown command is a usage error' 2 $?
bash "$script" fleet --repos "$work/absent.txt" --fixtures "$work/fleet" >/dev/null 2>&1
Expand Down
4 changes: 0 additions & 4 deletions components/commit-convention/commit-convention.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ $1" "$yaml_package" "${@:2}"
# Comma-joined, sorted types.
sorted_csv() { tr ',' '\n' | sed '/^$/d' | LC_ALL=C sort | paste -sd, -; }

# --- The file itself ---
parsed="$(node_eval 'const d = yaml.parse(fs.readFileSync(process.argv[2], "utf8"));
process.stdout.write(JSON.stringify([d.dialect, d.subject_pattern, d.pr_title_pattern]));' "$source_file")"
rc=$?
Expand All @@ -73,7 +72,6 @@ git -C "$root" ls-files --error-unmatch -- "$well_known" >/dev/null 2>&1
rc=$?
assert_exit "this repository tracks $well_known" 0 "$rc"

# --- Types lockstep ---
file_types="$(sed -E -n 's/^\^\(\(([a-z|]+)\).*/\1/p' <<<"$pattern" | tr '|' ',' | sorted_csv)"
if [[ -n "$file_types" ]]; then
pass 'the type alternation is extractable from subject_pattern'
Expand Down Expand Up @@ -110,7 +108,6 @@ else
fail "fetched check-contract action.yml at ${contract_pin:0:7}" 'fetch-error: the contents API read failed'
fi

# --- The resolver reads the tracked file at the well-known path ---
repo="$TEST_TMPDIR/consumer"
make_repo "$repo"
mkdir -p "$repo/${well_known%/*}"
Expand All @@ -136,7 +133,6 @@ rc=$?
assert_exit 'resolver resolves subject_pattern in this repository' 0 "$rc"
assert_eq "this repository's resolved pattern is the component's" "$pattern" "$out"

# --- The commit-msg hook accepts and rejects ---
check_subject() {
local subject="$1" msg="$TEST_TMPDIR/msg"
printf '%s\n' "$subject" >"$msg"
Expand Down
4 changes: 0 additions & 4 deletions components/local-lane-guards/local-lane-guards.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ guard_in() {
)
}

# --- exec-bit ---
make_repo "$tmpdir/exec-clean"
printf '#!/usr/bin/env bash\necho ok\n' >"$tmpdir/exec-clean/ok.sh"
git -C "$tmpdir/exec-clean" add ok.sh
Expand Down Expand Up @@ -126,7 +125,6 @@ else
pass 'exec-bit stays bash-3.2-safe (no declare -A)'
fi

# --- machine-specific-paths ---
make_repo "$tmpdir/path-clean"
printf 'root = <repo-root>/src\n' >"$tmpdir/path-clean/config.ini"
git -C "$tmpdir/path-clean" add config.ini
Expand Down Expand Up @@ -201,7 +199,6 @@ chmod +x "$path_spawn/bin/git" "$path_spawn/bin/head"
assert_eq 'machine-specific-paths greps the index once' '1' "$(cat "$path_spawn/grep")"
assert_eq 'machine-specific-paths does not spawn head to cap output' '0' "$(cat "$path_spawn/head")"

# --- comment-hygiene ---
make_repo "$tmpdir/ch-clean"
printf '# A plain explanatory comment.\necho ok\n' >"$tmpdir/ch-clean/clean.sh"
git -C "$tmpdir/ch-clean" add clean.sh
Expand Down Expand Up @@ -243,7 +240,6 @@ chmod +x "$ch_spawn/bin/awk"
)
assert_eq 'comment-hygiene does not spawn awk per git-grep hit' '0' "$(cat "$ch_spawn/awk")"

# --- reference-integrity ---
make_repo "$tmpdir/ref-clean"
printf '# Target\n\nBody.\n' >"$tmpdir/ref-clean/target.md"
# shellcheck disable=SC2016 # backticks are markdown cite syntax, not shell expansion
Expand Down
1 change: 0 additions & 1 deletion components/lychee/private-repo-inventory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ if [[ "$command" == generate ]]; then
exit 0
fi

# ---- check ---------------------------------------------------------------
status=0
problem() {
printf 'DRIFT: %s\n' "$*" >&2
Expand Down
6 changes: 0 additions & 6 deletions components/lychee/private-repo-inventory.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ write_config "$config" 'alpha|beta|gamma' 'alpha|beta|gamma'
printf '%s\n' public-one public-two >"$work/public.txt"
printf '%s\n' alpha beta gamma >"$work/private.txt"

# --- list ------------------------------------------------------------------
out="$(bash "$script" list --config "$config")"
assert_eq 'list prints one inventory entry per line' $'alpha\nbeta\ngamma' "$out"

# --- check: agreement ------------------------------------------------------
out="$(bash "$script" check --config "$config" --public-list "$work/public.txt" --private-list "$work/private.txt" 2>&1)"
assert_exit 'check passes when the inventory equals the private set' 0 $?
assert_contains 'check reports agreement' "$out" 'OK:'
Expand All @@ -57,14 +55,12 @@ assert_contains 'the regenerated github entry includes it, sorted' "$out" \
assert_contains 'the regenerated raw entry includes it, sorted' "$out" \
"'^https?://raw\\.githubusercontent\\.com/melodic-software/(alpha|beta|delta|gamma)/',"

# --- check: an excluded repo that went public ------------------------------
printf '%s\n' public-one beta >"$work/public-beta.txt"
out="$(bash "$script" check --config "$config" --public-list "$work/public-beta.txt" 2>&1)"
assert_exit 'check fails when an excluded repo is public' 1 $?
assert_contains 'the wrongly excluded repo is named' "$out" 'beta is public but excluded as private'
assert_contains 'the regenerated entry drops it' "$out" '/(alpha|gamma)(\.git)?'

# --- check: structural invariants ------------------------------------------
write_config "$work/unsorted.toml" 'gamma|alpha|beta' 'gamma|alpha|beta'
out="$(bash "$script" check --config "$work/unsorted.toml" --public-list "$work/public.txt" 2>&1)"
assert_exit 'check fails on an unsorted alternation' 1 $?
Expand All @@ -80,7 +76,6 @@ printf '%s\n' alpha my.repo >"$work/private-dotted.txt"
out="$(bash "$script" check --config "$work/dotted.toml" --public-list "$work/public.txt" --private-list "$work/private-dotted.txt" 2>&1)"
assert_exit 'a dotted repo name round-trips through regex escaping' 0 $?

# --- generate ----------------------------------------------------------------
out="$(bash "$script" generate --config "$config" --private-list "$work/private-plus.txt")"
assert_contains 'generate prints the github entry' "$out" \
"'^https?://github\\.com/melodic-software/(alpha|beta|delta|gamma)(\\.git)?([/#?]|\$)',"
Expand All @@ -103,7 +98,6 @@ out="$(bash "$script" generate --config "$config" --private-list "$work/empty.tx
assert_exit 'generate refuses an empty private set' 2 $?
assert_contains 'the refusal is explicit' "$out" 'refusing to generate an empty inventory'

# --- usage errors ------------------------------------------------------------
out="$(bash "$script" check --config "$work/missing.toml" 2>&1)"
assert_exit 'a missing config is a usage error' 2 $?
out="$(bash "$script" frobnicate 2>&1)"
Expand Down
Loading
Loading