#!/bin/sh # Tests for bin/check-escalation. # # #5 asked whether SKILL.md needs first-class failure/escalation fields and # decided: not frontmatter (nothing reads it), a body section (the model reads # that). #37 then had to define WHICH skills need one, and every obvious answer # was bad — a hardcoded list rots, content sniffing is unfalsifiable, a # frontmatter flag is the rejected option through the back door. # # So there is no acting set. EVERY skill answers the question; a read-only one # answers it in a line. The classification problem disappears, and "this skill # never hands back" becomes a stated claim rather than an absence. # # bin/escalation-pending.txt is a ratchet for skills whose real rule has not # been written yet. It is self-cleaning: a skill that has a section AND is still # listed fails, so the list cannot silently outlive its reason. set -u ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) SUT="$ROOT/bin/check-escalation" pass=0 fail=0 WORK=${TMPDIR:-/tmp}/check_escalation_test.$$ if [ ! -f "$SUT" ]; then printf 'FAIL: %s does not exist\n' "$SUT" exit 1 fi cleanup() { rm -rf "$WORK"; } trap cleanup EXIT INT TERM # fixture — an empty checkout with a bin/ for the pending list. fixture() { _f="$WORK/$1" mkdir -p "$_f/skills" "$_f/bin" : > "$_f/bin/escalation-pending.txt" printf '%s' "$_f" } # skill skill() { mkdir -p "$1/skills/$2" { printf -- '---\nname: %s\ndescription: d\n---\n\n# %s\n' "$2" "$2" [ "$3" = yes ] && printf '\n## Escalation\n\nStop and hand back when X. Hand back by: saying so.\n' } > "$1/skills/$2/SKILL.md" } # expect