chore: drop redundant apm-marketplace-check and Copilot marketplace mirror (findings 1, 2)
apm-marketplace-check checked network reachability of remote marketplace refs, but finding 35 already removed the only remote package entry, so every marketplace.packages[] source is local and the hook is pure overlap with apm-pack-check-clean. apm-audit-ci was re-examined and kept as-is -- its pre-commit-config.yaml comment already carries a dated, verified justification the audit had missed. check-marketplace-mirror-sync guarded .github/plugin/marketplace.json against drift from .claude-plugin/marketplace.json. Verified against current GitHub Copilot CLI docs: Copilot's marketplace discovery already falls back through .github/plugin/marketplace.json to .claude-plugin/marketplace.json, which this repo generates anyway -- the dedicated mirror bought a discovery-order preference, not a capability. Deleted the mirror file, its sync script, its test, and the hook. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YR2CjVumUbEGWcMikcoXBD
This commit is contained in:
@@ -1,81 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# .claude-plugin/marketplace.json is apm's compiled Claude marketplace output (see
|
||||
# apm.yml's marketplace.outputs.claude). GitHub Copilot CLI's manifest lookup accepts
|
||||
# that same file at .claude-plugin/marketplace.json directly, but also has a legacy
|
||||
# convention path at .github/plugin/marketplace.json (see
|
||||
# plugins/kyberforge/docs/research/docs/github-copilot-plugins/marketplace.md) -- and
|
||||
# that path is a mirror of the Claude output, not a separate apm output profile (this
|
||||
# repo declares only the "claude" output). This script keeps that legacy mirror
|
||||
# byte-identical to .claude-plugin/marketplace.json instead of letting it silently
|
||||
# drift (see issue #90 comment thread).
|
||||
|
||||
# Hard error, not a `|| pwd` fallback. Every path this script touches hangs off
|
||||
# REPO_ROOT, and both of its exits-0 paths are "the files agree" or "neither file
|
||||
# exists" -- so a REPO_ROOT pointing somewhere that is not this repo reports "no
|
||||
# drift" over a tree it never looked at. Run `--check` from an empty directory
|
||||
# outside any worktree and the fallback made that the literal outcome: rev-parse
|
||||
# failed, REPO_ROOT became $PWD, neither file was there, exit 0. Refusing to guess
|
||||
# is the only answer that cannot be silently wrong; the `-f "$DST"` branch below
|
||||
# covers a genuinely stale mirror, which is a different condition.
|
||||
if ! REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" || [[ -z "$REPO_ROOT" ]]; then
|
||||
echo "Error: not inside a git worktree -- cannot locate the repository root, and guessing \$PWD would let --check report \"no drift\" over a tree it never inspected. Run this from within the repository." >&2
|
||||
exit 1
|
||||
fi
|
||||
SRC="$REPO_ROOT/.claude-plugin/marketplace.json"
|
||||
DST="$REPO_ROOT/.github/plugin/marketplace.json"
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [--check]" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
CHECK=0
|
||||
if [[ "${1:-}" == "--check" ]]; then
|
||||
CHECK=1
|
||||
shift
|
||||
fi
|
||||
[[ $# -eq 0 ]] || usage
|
||||
|
||||
if [[ ! -f "$SRC" ]]; then
|
||||
# A missing source with a surviving mirror is drift, not absence: the mirror
|
||||
# can only be stale (nothing is left for it to be byte-identical to), which is
|
||||
# precisely the silent divergence this script exists to prevent. Exiting 0
|
||||
# here would report "no drift" over a mirror of a file that no longer exists.
|
||||
# (An unresolvable REPO_ROOT is handled above and is a hard error; this branch
|
||||
# is only about a source file that is genuinely gone from a real worktree.)
|
||||
# scripts/sync-plugin-content.sh --check --all already errors on the same
|
||||
# condition ("requires .../marketplace.json"); this matches it.
|
||||
# Neither file present stays a genuine no-op: nothing to mirror, nothing stale.
|
||||
if [[ "$CHECK" -eq 1 && -f "$DST" ]]; then
|
||||
echo "DRIFT $DST: mirror exists but .claude-plugin/marketplace.json does not" >&2
|
||||
echo "Fix: restore .claude-plugin/marketplace.json (apm's compiled Claude marketplace output), or delete $DST" >&2
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$CHECK" -eq 1 ]]; then
|
||||
if [[ ! -f "$DST" ]] || ! diff -q "$SRC" "$DST" >/dev/null 2>&1; then
|
||||
echo "DRIFT $DST: out of sync with .claude-plugin/marketplace.json" >&2
|
||||
# The runnable command gets a line to ITSELF, and the rationale gets its own
|
||||
# echo. It was one line -- `Fix: bash scripts/sync-marketplace-mirror.sh --
|
||||
# apm ships no output profile...` -- which put the prose after `--`, the
|
||||
# POSIX end-of-options marker, so copy-pasting the Fix line ran this script
|
||||
# with ~24 stray argv entries: `${1:-}` was `--` (so CHECK stayed 0 and no
|
||||
# shift happened), `[[ $# -eq 0 ]]` failed, and the tool meant to fix the
|
||||
# drift answered with its own usage error and exit 1. The backticks around
|
||||
# `apm pack` made it worse: the paste also command-substituted a real
|
||||
# `apm pack` run before the script was even reached. Hence plain quotes
|
||||
# below too. Keep the command alone on its line.
|
||||
echo "Fix: run, from the repository root:" >&2
|
||||
echo " bash scripts/sync-marketplace-mirror.sh" >&2
|
||||
echo "Note: apm ships no output profile targeting this path, so 'apm pack' does not refresh it. Expecting it to is exactly the drift this script and its pre-push hook exist to prevent." >&2
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$DST")"
|
||||
cp "$SRC" "$DST"
|
||||
@@ -196,9 +196,9 @@ if [[ "$ALL" -eq 1 ]]; then
|
||||
# duplicate at every call site (see .pre-commit-config.yaml's
|
||||
# check-plugin-content-sync).
|
||||
#
|
||||
# Hard error rather than a `|| pwd` fallback, on scripts/sync-marketplace-mirror.sh's
|
||||
# reasoning: --all's entire work list hangs off REPO_ROOT, so a REPO_ROOT pointing at
|
||||
# something that is not this repo checks a plugin set that is not this repo's. Run
|
||||
# Hard error rather than a `|| pwd` fallback: --all's entire work list hangs off
|
||||
# REPO_ROOT, so a REPO_ROOT pointing at something that is not this repo checks a
|
||||
# plugin set that is not this repo's. Run
|
||||
# from outside a worktree the fallback happens to hit the `--all requires ...` error
|
||||
# below instead -- but only by accident, because $PWD had no marketplace.json in it;
|
||||
# $PWD holding an unrelated one is the case that would silently "pass".
|
||||
|
||||
Reference in New Issue
Block a user