Files
CASAN/AINative_OKR_CASAN5/.specify/scripts/bash/model-router.sh
T
2026-07-06 21:47:38 +09:00

22 lines
1021 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# CASAN model router (Phase 3, Wave 1) — entry point.
# model-router.sh <prompt-file> <out-json> [--role classify|judge|generate] [--model ollama:ornith:9b]
#
# Thin dispatcher over model-call.py (the HTTP/parse/hardening workhorse) so the
# documented interface stays stable. All real behavior, allowlist, fail-closed,
# and usage logging live in model-call.py.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Opt-in governance preflight (default off ⇒ no change to existing flows).
# When enabled, enforces RAI data governance (e.g. PII must not reach a cloud
# model without approval) BEFORE the model call. SEC-17 (ARCH-03): default ON under
# CASAN_PROFILE=prod (secure-by-default); an explicit CASAN_PREFLIGHT=0 still wins.
if [[ "${CASAN_PREFLIGHT:-0}" == "1" || ( -z "${CASAN_PREFLIGHT+x}" && "${CASAN_PROFILE:-}" == "prod" ) ]]; then
bash "$SCRIPT_DIR/harness-preflight.sh" "$@" >/dev/null || exit $?
fi
exec python "$SCRIPT_DIR/model-call.py" "$@"