#!/usr/bin/env bash # End-to-end check for the shared deleted-upstream skill denylist. # # The same source-controlled file must drive both paths. home.nix copies it to # the Nix store and reads it in home.activation.removeDeletedUpstreamSkills. # rebuild.sh reads it from its own checkout before calling the Skills CLI. This # check compares the Nix copy with the source file and confirms rebuild.sh uses # the same name to filter CLI arguments. The CLI call itself is exercised with # spies in tests/rebuild-update-steps.py. set -euo pipefail ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P) LIST="$ROOT/deleted-upstream-skills.txt" CONFIG='(builtins.getFlake (toString '"$ROOT"')).darwinConfigurations."lt-mbp".config.home-manager.users.laptran' fail() { printf 'FAIL: %s\n' "$1" >&2; exit 1; } pass() { printf 'PASS: %s\n' "$1"; } command -v nix >/dev/null 2>&1 \ || { echo "skill-denylist: nix is required to evaluate the configuration" >&2; exit 2; } [ -r "$LIST" ] || fail "denylist missing at $LIST" expected='agent-self-scheduling codex-goal-loop delegating-to-agents markdown-rendering run-deep-swe cyber-audit pi-custom-model vps-server-management pi-web-search research-prompt youtube-polls youtube-transcript distribute-skill-to-all-agents folder-specific-claude-and-agents-md push-skill-to-github brain-to-docs grill-me interview-style-doc-building short teach' [ "$(cat "$LIST")" = "$expected" ] || fail "denylist does not hold the 20 expected names" pass "denylist holds the 20 deleted upstream skills" activation=$(nix eval --raw --impure --expr "$CONFIG.home.activation.removeDeletedUpstreamSkills.data") nix_list=$(printf '%s\n' "$activation" | sed -n 's/^deny_file=//p') [ -n "$nix_list" ] || fail "activation script does not reference a denylist file" cmp -s "$nix_list" "$LIST" || fail "Nix denylist copy differs from $LIST" pass "home.nix activation reads the same denylist" # shellcheck disable=SC2016 # the literal line in rebuild.sh is the assertion grep -qF 'DENYLIST="$DIR/deleted-upstream-skills.txt"' "$ROOT/rebuild.sh" \ || fail "rebuild.sh does not read the shared denylist" grep -qF 'name not in denied' "$ROOT/rebuild.sh" \ || fail "rebuild.sh does not filter denied names from the Skills CLI call" pass "rebuild.sh reads the same denylist and filters CLI arguments"