feat(lint): wire Vale as deterministic prefilter for skill-audit/agent-audit #85
@@ -17,10 +17,22 @@ err() { echo " FAIL: $1" >&2; FAIL=$((FAIL + 1)); }
|
||||
SKILL_AUDIT="$REPO_ROOT/plugins/kyberforge/skills/skill-audit"
|
||||
AGENT_AUDIT="$REPO_ROOT/plugins/kyberforge/skills/agent-audit"
|
||||
|
||||
if [[ ! -d "$SKILL_AUDIT" || ! -d "$AGENT_AUDIT" ]]; then
|
||||
if [[ ! -d "$SKILL_AUDIT" && ! -d "$AGENT_AUDIT" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Exactly one present is drift, not absence: the missing copy can't be in sync
|
||||
# with the surviving one, and treating it as a no-op is how a deleted or
|
||||
# renamed copy would slip through silently.
|
||||
if [[ ! -d "$SKILL_AUDIT" ]]; then
|
||||
echo "Vale style sync check failed: $AGENT_AUDIT exists but $SKILL_AUDIT does not — run scripts/sync-vale-styles.sh to regenerate skill-audit's copy." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d "$AGENT_AUDIT" ]]; then
|
||||
echo "Vale style sync check failed: $SKILL_AUDIT exists but $AGENT_AUDIT does not — agent-audit holds the canonical copy, so restore it before syncing." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! diff -q "$SKILL_AUDIT/scripts/vale-wrap.sh" "$AGENT_AUDIT/scripts/vale-wrap.sh" >/dev/null 2>&1; then
|
||||
err "scripts/vale-wrap.sh differs between skill-audit and agent-audit"
|
||||
fi
|
||||
|
||||
@@ -86,6 +86,27 @@ else
|
||||
fail "exited non-zero when skill-audit/agent-audit are simply absent"
|
||||
fi
|
||||
|
||||
# --- 6. Exits 1 when only one of the two copies is present ---
|
||||
# The no-op guard used `||`, so a single missing copy also exited 0 — a deleted
|
||||
# or renamed copy passed the sync check silently.
|
||||
echo ""
|
||||
echo "--- exits 1 when only one of the two copies is present ---"
|
||||
FIXTURE6="$(make_fixture)"
|
||||
FIXTURE7="$(make_fixture)"
|
||||
trap 'rm -rf "$FIXTURE" "$FIXTURE2" "$FIXTURE3" "$FIXTURE4" "$FIXTURE5" "$FIXTURE6" "$FIXTURE7"' EXIT
|
||||
rm -rf "$FIXTURE6/plugins/kyberforge/skills/skill-audit"
|
||||
rm -rf "$FIXTURE7/plugins/kyberforge/skills/agent-audit"
|
||||
if bash "$SCRIPT" "$FIXTURE6" > /dev/null 2>&1; then
|
||||
fail "exited 0 when only agent-audit is present — expected exit 1"
|
||||
else
|
||||
pass "exits non-zero when skill-audit's copy is missing but agent-audit's is present"
|
||||
fi
|
||||
if bash "$SCRIPT" "$FIXTURE7" > /dev/null 2>&1; then
|
||||
fail "exited 0 when only skill-audit is present — expected exit 1"
|
||||
else
|
||||
pass "exits non-zero when agent-audit's canonical copy is missing but skill-audit's is present"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Results: $PASS passed, $FAIL failed"
|
||||
[[ $FAIL -eq 0 ]]
|
||||
|
||||
Reference in New Issue
Block a user