Make the local provider's address mean opposite things in the two phases: required in the smoke, refused while money is on the wire.

This commit is contained in:
heaven 2026-09-11 04:27:35 +03:00
parent a37799155e
commit 44b33d9744

View file

@ -25,6 +25,12 @@ PSQL=${PSQL:-$HOME/.local/pgsql/bin/psql}
JAR=${JAR:-$W/stand/cookies-paid.txt}
# The pack's money stop, in micro-USD. Reaching it is a STOP and a ping, not a decision of this script.
STOP_AT_MICRO=${STOP_AT_MICRO:-1000000}
# Which phase this stand is in, because the SAME fact means opposite things in the two. In the smoke
# a listener on the local provider's address is the instrument; in the paid phase it is a hazard —
# a pipeline that still reached a local model would be served fake prose at $0 and the run would
# measure nothing while looking perfectly green.
PHASE=${PHASE:-paid}
export TM_PLATFORM_DSN=${TM_PLATFORM_DSN:-$DSN}
say() { printf '%s\n' "$*"; }
die() { printf '⛔ %s\n' "$*" >&2; exit 1; }
@ -48,11 +54,28 @@ step_gate() {
[ "$mod" = "false" ] || { say " ⛔ built from a dirty tree"; bad=1; }
done
say "=== the stand is MINE: pid on each port, not a 200 from someone else's process ==="
for p in 11434 ${ADDR##*:}; do
local line; line=$(ss -ltnp "sport = :$p" 2>/dev/null | tail -n +2)
[ -n "$line" ] || { say " port $p: nothing is listening"; bad=1; continue; }
say " port $p: $(printf '%s' "$line" | sed 's/.*users://')"
done
local line
line=$(ss -ltnp "sport = :${ADDR##*:}" 2>/dev/null | tail -n +2)
if [ -n "$line" ]; then
say " port ${ADDR##*:}: $(printf '%s' "$line" | sed 's/.*users://')"
else
say " port ${ADDR##*:}: ⛔ nothing is listening — there is no stand"; bad=1
fi
line=$(ss -ltnp "sport = :11434" 2>/dev/null | tail -n +2)
case "$PHASE" in
smoke)
if [ -n "$line" ]; then say " port 11434 (the \$0 stub, required in this phase): $(printf '%s' "$line" | sed 's/.*users://')"
else say " port 11434: ⛔ the smoke has no stub to answer the local provider"; bad=1; fi ;;
*)
if [ -n "$line" ]; then
say " port 11434: ⛔ something is LISTENING on the local provider's address during a paid phase:"
say " $(printf '%s' "$line" | sed 's/.*users://')"
say " a configuration that still reached a local model would be served free prose and the run would measure nothing"
bad=1
else
say " port 11434: nothing listens (control: $(ss -ltn | tail -n +2 | wc -l) listeners on this host) — a local model would now fail LOUDLY"
fi ;;
esac
say "=== what will be bought: the pipeline, its contrast artefact, the template ==="
# Printed AND checked against the pre-registration when it is given: printing alone leaves the
# comparison to a reader who has the other number somewhere else.