mirror of
https://github.com/boshu2/agentops.git
synced 2026-09-14 15:08:13 +08:00
42 lines
1.3 KiB
Bash
Executable File
42 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# validate-embedded-sync.sh — Verify embedded copies match source lib/skills.
|
|
# Exits non-zero if any embedded file is stale (doesn't match source).
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
EMBEDDED="$REPO_ROOT/cli/embedded"
|
|
ERRORS=0
|
|
|
|
check_file() {
|
|
local src="$1" dst="$2"
|
|
if [[ ! -f "$dst" ]]; then
|
|
echo "MISSING: $dst (source: $src)"
|
|
ERRORS=$((ERRORS + 1))
|
|
return
|
|
fi
|
|
if ! diff -q "$src" "$dst" >/dev/null 2>&1; then
|
|
echo "STALE: $dst differs from $src"
|
|
ERRORS=$((ERRORS + 1))
|
|
fi
|
|
}
|
|
|
|
# Check skills/standards/references/*
|
|
for f in "$REPO_ROOT"/skills/standards/references/*; do
|
|
basename=$(basename "$f")
|
|
check_file "$f" "$EMBEDDED/skills/standards/references/$basename"
|
|
done
|
|
|
|
# Check the flywheel compile runtime script. Canonical home moved to scripts/lib/
|
|
# when the compile SKILL retired (2026-07-07 wave, l6ic.12) — `ao compile` still
|
|
# ships the embedded copy; the embedded PATH is unchanged (Go embed contract).
|
|
check_file "$REPO_ROOT/scripts/lib/flywheel-compile.sh" "$EMBEDDED/skills/compile/scripts/compile.sh"
|
|
|
|
if [[ $ERRORS -gt 0 ]]; then
|
|
echo ""
|
|
echo "ERROR: $ERRORS embedded file(s) are out of sync."
|
|
echo "Run 'cd cli && make sync-hooks' to fix."
|
|
exit 1
|
|
fi
|
|
|
|
echo "All embedded files are in sync."
|