#!/usr/bin/env bash
# ai_node/teach_skill.sh — teach the bundled AI node a NEW skill from your own
# worked examples, via the vendored S053 topic-agnostic skill-birth engine.
# Wire-only: the sha-pin gate, the authored standard, the ADOPT decision and
# the constructive refusal all come from the vendored engine, not this script.
#
#   usage: teach_skill.sh <family.json>
#
# Two ready-made example families ship in ai_node/skill_birth/examples/:
#   teach_adoptable.json  -> expect ADOPT (examples bracket the rule exactly)
#   teach_ambiguous.json  -> expect a constructive UNDERDETERMINED refusal
#                            naming the exact input to label next
# Input shape + honest scope: GUIDE.md, "Teach it a new skill".
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
if [ "$#" -ne 1 ]; then
  echo "usage: $0 <family.json>" >&2
  exit 2
fi
[ -f "$1" ] || { echo "no such file: $1" >&2; exit 3; }
exec python3 "$HERE/skill_birth/teach.py" "$1"
