From 7c192f068f9b20d5e70fd722ebe6bc3d1f41f98b Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 7 Oct 2026 12:24:14 +0100 Subject: [PATCH] test(e2e): assert menu tiers match manifests, not that Teranga is non-empty Since the bundled cartridges/ tree was retired, the E2E catalogue is tests/fixtures/cartridges, whose 23 manifests all declare tier Ayo, so 'teranga tier has cartridges' could never pass. Assert instead that each tier holds exactly the cartridges whose manifest declares it, and that the three tiers sum to summary.total, so no cartridge drops out. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019j8She9eTFx54r6aL6sCHP Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> --- tests/e2e_full.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/e2e_full.sh b/tests/e2e_full.sh index 2ffab9dc..1151dc44 100755 --- a/tests/e2e_full.sh +++ b/tests/e2e_full.sh @@ -181,9 +181,20 @@ menu=$(curl -sf "$BASE_URL/menu" 2>/dev/null || echo "{}") check "menu endpoint returns data" '"tier_teranga"' "$menu" check "menu contains teranga tier" 'teranga' "$menu" -# Count cartridges in the teranga tier -teranga_count=$(echo "$menu" | jq '.tier_teranga | length' 2>/dev/null || echo "0") -check "teranga tier has cartridges" "1" "$([ "$teranga_count" -gt 0 ] && echo 1 || echo 0)" +# Each tier holds exactly the cartridges whose manifest declares it. This +# does not assume any tier is non-empty: the fixture catalogue is all Ayo, +# and tier assignments are being re-audited (trust-tier ADR). +for tier in teranga shield ayo; do + expected=$(jq -s --arg t "$tier" '[.[] | select((.tier // "" | ascii_downcase) == $t)] | length' \ + "$BOJ_CARTRIDGES_PATH"/*/cartridge.json 2>/dev/null || echo "manifests-unreadable") + actual=$(echo "$menu" | jq ".tier_${tier} | length" 2>/dev/null || echo "menu-unreadable") + check "${tier} tier matches manifests (${expected})" "^${expected}\$" "$actual" +done + +# No cartridge may fall outside the three tiers. +tiered=$(echo "$menu" | jq '[.tier_teranga, .tier_shield, .tier_ayo] | map(length) | add' 2>/dev/null || echo "menu-unreadable") +total=$(echo "$menu" | jq '.summary.total' 2>/dev/null || echo "menu-unreadable") +check "every cartridge is in a tier (${total})" "^${total}\$" "$tiered" echo "" # ═══════════════════════════════════════════════════════════════════════