diff --git a/scripts/pm/os-verify-lock.sh b/scripts/pm/os-verify-lock.sh index b649b5b1c6..b23c41f6ca 100755 --- a/scripts/pm/os-verify-lock.sh +++ b/scripts/pm/os-verify-lock.sh @@ -193,12 +193,32 @@ FLOCK_BIN="${OS_VERIFY_LOCK_FLOCK:-flock}" QUEUE_DIR="${LOCK_FILE}.q" HOLDER_FILE="${LOCK_FILE}.holder" +# `OS_VERIFY_LOCK_LEDGER` exists for the same reason `OS_VERIFY_LOCK_FILE` does: +# so --self-test can exercise the recording without writing fixtures into the +# fleet's real measurement record. Pointing real verification at a private +# ledger just makes its runs invisible to `--report`; don't. +LEDGER_FILE="${OS_VERIFY_LOCK_LEDGER:-${LOCK_FILE}.ledger}" readonly TICKET_MAX_AGE_S=$((HARD_CAP_S + 300)) +# How long a PARKED slot keeps the arrival stamp it is holding a place with. +# Three budgets: long enough that an agent doing lock-free work between +# attempts still finds its place, short enough that the priority a slot carries +# over later arrivals is bounded and declared rather than indefinite. +readonly SLOT_MAX_AGE_S=$((HARD_CAP_S * 3)) + +# Past this the ledger stops growing. A record is ~150 bytes, so this is tens +# of thousands of runs; `--report` says so rather than silently reporting on a +# truncated population. +readonly LEDGER_MAX_BYTES=8388608 + SELF="${BASH_SOURCE[0]}" TICKET="" HOLDING=0 BUDGET_NOTE="" +SLOT_SLUG="" +ARRIVAL_DEPTH=-1 +LEDGER_WRITTEN=0 +LABEL_FOR_LEDGER="?" log() { printf 'os-verify-lock: %s\n' "$*" >&2; } @@ -348,36 +368,168 @@ queue_usable() { } # ticket file: "