fix(wake): #925 framework-ship canon fallback-wake (systemd timer + schema bound + A10 install/validate) — F7 out of the box (#931)
Co-authored-by: jason.woltje <jason@diversecanvas.com> Co-committed-by: jason.woltje <jason@diversecanvas.com>
This commit was merged in pull request #931.
This commit is contained in:
@@ -398,6 +398,53 @@ EOF
|
||||
"$STORE" consume --upto 6 >/dev/null 2>&1 || fail_msg "D8: CONSUMED 6 must succeed over the contiguous prefix after the delta"
|
||||
) && ok
|
||||
|
||||
echo "== D9: schema (#925) — optional per-class fallback_cadence is BACKWARD-COMPAT (in-range accepted; out-of-range still FAILS LOUD, Gate B intact) =="
|
||||
(
|
||||
WAKE_STATE_HOME="$(fresh_state d9)"
|
||||
export WAKE_STATE_HOME
|
||||
unset WAKE_AGENT
|
||||
stub="$TMP_ROOT/d9stub"
|
||||
mkdir -p "$stub"
|
||||
make_stub "$stub"
|
||||
export WAKE_DETECTOR_SOURCE_CMD="$stub/adapter.sh"
|
||||
printf 'SHA-D9\n' >"$stub/repo_r1"
|
||||
printf '## LANE-X\nx\n' >"$stub/board_file_b1"
|
||||
# A watch-list that EXERCISES the new optional additive field: a per-class
|
||||
# `fallback_cadence` under an slos tier, at schema_version 1. Because the field is
|
||||
# OPTIONAL + additive, an existing schema_version-1 watch-list stays valid and the
|
||||
# detector's Gate B range [schema_min, schema_max] is UNCHANGED — the new field
|
||||
# must NOT push the watch-list out of range.
|
||||
wl="$TMP_ROOT/d9.json"
|
||||
write_fc_watchlist() {
|
||||
local file="$1" ver="$2"
|
||||
cat >"$file" <<EOF
|
||||
{
|
||||
"schema_version": $ver,
|
||||
"slos": {
|
||||
"actionable-tier": { "class": "actionable", "fallback_bound": "30m", "fallback_cadence": "1h" }
|
||||
},
|
||||
"repos": [{ "id": "r1", "remote": "example/repo", "class": "digest" }],
|
||||
"board_files": [{ "id": "b1", "path": "BOARD.md", "anchor": "## LANE-X" }],
|
||||
"watches": [
|
||||
{ "lane": "lane-x", "sources": [
|
||||
{ "kind": "repo", "id": "r1" },
|
||||
{ "kind": "board_file", "id": "b1" }
|
||||
] }
|
||||
]
|
||||
}
|
||||
EOF
|
||||
}
|
||||
# (a) in-range (schema_version 1) WITH fallback_cadence -> ACCEPTED.
|
||||
write_fc_watchlist "$wl" 1
|
||||
export WAKE_WATCH_LIST="$wl"
|
||||
"$DET" poll-once >/dev/null 2>&1 || fail_msg "D9: an in-range watch-list carrying the optional fallback_cadence must be ACCEPTED (additive/backward-compatible)"
|
||||
# (b) out-of-range (schema_version 999) WITH the SAME field -> STILL FAILS LOUD.
|
||||
write_fc_watchlist "$wl" 999
|
||||
err="$("$DET" poll-once 2>&1)"; rc=$?
|
||||
[ "$rc" -ne 0 ] || fail_msg "D9: the new field must NOT weaken Gate B — an out-of-range schema_version must still FAIL LOUD (rc=$rc)"
|
||||
echo "$err" | grep -qi 'range' || fail_msg "D9: the out-of-range failure must still state it is out of the supported range [$err]"
|
||||
) && ok
|
||||
|
||||
echo
|
||||
if [ -s "$FAILFILE" ]; then
|
||||
echo "wake detector harness: FAILED ($(grep -c . "$FAILFILE") assertion(s))" >&2
|
||||
|
||||
Reference in New Issue
Block a user