From 072e91c3579c561b7c61157f62148333e40ea1ab Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 30 Sep 2026 15:07:40 +0100 Subject: [PATCH] =?UTF-8?q?test(gates):=20add=20tests=20for=205=20gate=20s?= =?UTF-8?q?cripts=20(untested=2040=E2=86=9235)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a fail-capable test for each of check-uuid-v7, check-mustfile-structure, check-language-guide, run-shell-test-suite and check-descriptile-policy (60 assertions; each gate shown able to fail for the right reason). gate-scripts-without-tests is re-measured at 35 and its count and ceiling are lowered 40→35, so the ratchet tightens rather than merely holding. Fixtures that the real uuid/descriptile gates would flag are assembled at runtime, because the scripts/*.sh pathspec also covers scripts/tests/. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WPSJ7fBhVAMcpSffCBWUDo Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> --- .machine_readable/Debtfile.a2ml | 4 +- scripts/tests/descriptile-policy-test.sh | 71 ++++++++++++++++++ scripts/tests/language-guide-test.sh | 64 +++++++++++++++++ scripts/tests/mustfile-structure-test.sh | 91 ++++++++++++++++++++++++ scripts/tests/shell-test-suite-test.sh | 60 ++++++++++++++++ scripts/tests/uuid-v7-test.sh | 62 ++++++++++++++++ 6 files changed, 350 insertions(+), 2 deletions(-) create mode 100755 scripts/tests/descriptile-policy-test.sh create mode 100755 scripts/tests/language-guide-test.sh create mode 100755 scripts/tests/mustfile-structure-test.sh create mode 100755 scripts/tests/shell-test-suite-test.sh create mode 100755 scripts/tests/uuid-v7-test.sh diff --git a/.machine_readable/Debtfile.a2ml b/.machine_readable/Debtfile.a2ml index 288e64c4..2f05d36a 100644 --- a/.machine_readable/Debtfile.a2ml +++ b/.machine_readable/Debtfile.a2ml @@ -39,8 +39,8 @@ forgotten. ### gate-scripts-without-tests - description: Scripts under scripts/ with no matching scripts/tests/-test.sh — a gate with no test has never been shown able to fail Re-baselined 2026-09-22 (round 2, issue #953): the committed count had fossilized at 31 while the tree measured 38+; set to measured 40 with a declared ceiling raise. Falls automatically as tests land. - probe: n=0; for f in $(git ls-files 'scripts/*.sh'); do b=$(basename "$f" .sh); case "$b" in *-test) continue;; esac; if [ ! -f "scripts/tests/${b}-test.sh" ] && [ ! -f "scripts/tests/${b#check-}-test.sh" ] && [ ! -f "scripts/tests/${b#run-}-test.sh" ]; then n=$((n+1)); fi; done; echo "$n" -- count: 40 -- ceiling: 40 +- count: 35 +- ceiling: 35 - severity: high - policy: remediable - tri: eliminate diff --git a/scripts/tests/descriptile-policy-test.sh b/scripts/tests/descriptile-policy-test.sh new file mode 100755 index 00000000..93d78fdf --- /dev/null +++ b/scripts/tests/descriptile-policy-test.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# +# Proves check-descriptile-policy.sh CAN FAIL, and fails for the right reasons. +# +# The checker scans `scripts/*.sh`, and as a git pathspec that glob also matches +# scripts/tests/ — so it scans THIS file. The retired descriptile paths below are +# therefore ASSEMBLED FROM FRAGMENTS and never appear literally, or the real gate +# would turn red on its own test. +set -euo pipefail +SCRIPT="$(cd "$(dirname "$0")/.." && pwd)/check-descriptile-policy.sh" +WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT + +MR=".machine_readable" +STATE="$MR/STATE.a2ml" # retired flat path +META6="$MR/6a2/META.a2ml" # retired 6a2/ path +ANCHOR="$MR/ANCHOR.a2ml" # retired flat path +LIVE="$MR/descriptiles/STATE.a2ml" # the live location + +pass=0; fail=0 +expect() { # expect