refact(frank-zealot): serve gates run on the shared gate library
The three -e gates (runtime, GGUF, mmproj) are require_file calls: the refusal now names the artifact class, the exact path and the script that produces it. The seam asserts that observable triple instead of the old sentence order.
This commit is contained in:
@@ -28,6 +28,13 @@
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# The artifact gates are the shared library: the serve script and the
|
||||
# deployer must refuse the same missing payload with the same words
|
||||
# (scripts/lib/llm-gates.sh; the fleet law from the 2026-10-01 crash-loop).
|
||||
export GATE_PREFIX=frank-zealot
|
||||
# shellcheck disable=SC1091
|
||||
source "$SCRIPT_DIR/lib/llm-gates.sh"
|
||||
ENV_FILE="${FRANK_ZEALOT_ENV_FILE:-$SCRIPT_DIR/frank-zealot.env}"
|
||||
if [[ -f "$ENV_FILE" ]]; then
|
||||
set -a
|
||||
@@ -81,13 +88,18 @@ fi
|
||||
|
||||
# Fail loudly rather than half-loading: a missing file is a download that
|
||||
# has not finished, and Restart=always would turn it into a crash loop that
|
||||
# reads like a runtime fault.
|
||||
for path in "$LLAMA_BIN" "$MODEL_FILE"; do
|
||||
[[ -e "$path" ]] || { echo "frank-zealot: missing $path" >&2; exit 1; }
|
||||
done
|
||||
# reads like a runtime fault. The refusal text is the shared gate library's,
|
||||
# so the deployer's twin refuses identically (the 2026-10-01 crash-loop law).
|
||||
require_file "$LLAMA_BIN" runtime \
|
||||
"build it: scripts/build-llama-master-cuda.sh" || exit 1
|
||||
require_file "$MODEL_FILE" gguf \
|
||||
"fetch it: bash scripts/download-frank-zealot.sh" || exit 1
|
||||
if [[ -n "$MMPROJ_FILE" ]]; then
|
||||
require_file "$MMPROJ_FILE" mmproj \
|
||||
"fetch it: bash scripts/download-frank-zealot.sh" || exit 1
|
||||
fi
|
||||
EXTRA_ARGS=()
|
||||
if [[ -n "$MMPROJ_FILE" ]]; then
|
||||
[[ -e "$MMPROJ_FILE" ]] || { echo "frank-zealot: missing $MMPROJ_FILE" >&2; exit 1; }
|
||||
EXTRA_ARGS+=(--mmproj "$MMPROJ_FILE")
|
||||
fi
|
||||
|
||||
|
||||
@@ -253,15 +253,20 @@ run_stage() {
|
||||
}
|
||||
|
||||
@test "the serve script refuses a missing runtime, GGUF or projector" {
|
||||
# The refusal is the shared gate library's: it names the artifact class,
|
||||
# the exact path, and the script that produces it.
|
||||
rm -f "$MODEL_DIR/$MM_STUB"
|
||||
serve_argv
|
||||
[ "$status" -ne 0 ]
|
||||
[[ "$output" == *"frank-zealot: missing"* ]]
|
||||
[[ "$output" == *"frank-zealot:"* ]]
|
||||
[[ "$output" == *"mmproj"*"missing"*"$MM_STUB"* ]]
|
||||
[[ "$output" == *"download-frank-zealot.sh"* ]]
|
||||
|
||||
rm -f "$RUNTIME_DIR/bin/llama-server"
|
||||
serve_argv
|
||||
[ "$status" -ne 0 ]
|
||||
[[ "$output" == *"frank-zealot: missing"* ]]
|
||||
[[ "$output" == *"runtime"*"missing"*"llama-server"* ]]
|
||||
[[ "$output" == *"build-llama-master-cuda.sh"* ]]
|
||||
}
|
||||
|
||||
@test "the deploy handler gates on binary, GGUF and projector, then MainPID-hardens health" {
|
||||
|
||||
Reference in New Issue
Block a user