#!/usr/bin/env bash
# GENERATED smoke test. Land ORCHESTRATION is tested in the brain (test-finish-branch.sh). Here:
# (1) frozen facts still valid vs the live repo (drift→ok), (2) delegation/usage wired.
set -uo pipefail
SHIP="/home/user/Projects/platform/.claude/scripts/ship.sh"
pass=0; fail=0
ok(){ if [[ "$2" == "$3" ]]; then echo "PASS: $1"; pass=$((pass+1)); else echo "FAIL: $1 — got '$2' want '$3'"; fail=$((fail+1)); fi; }
bash "$SHIP" drift >/dev/null 2>&1; ok "drift: live frozen facts valid" "$?" "0"
out=$(bash "$SHIP" drift 2>/dev/null); ok "drift: status ok" "$(printf '%s' "$out" | grep -c '"status":"ok"')" "1"
bash "$SHIP" >/dev/null 2>&1; ok "usage: no args → exit2" "$?" "2"
bash "$SHIP" land >/dev/null 2>&1; ok "land: missing args → exit3 (delegated)" "$?" "3"
echo "── $pass passed, $fail failed ──"; [[ $fail -eq 0 ]]
