From 4699a5120504e337785ddc989c087e7fe7dba601 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 26 Aug 2026 16:53:03 +0100 Subject: [PATCH 1/2] fix(scripts): repoint checks at the .adoc files that exist The .md -> .adoc documentation migration moved these files but never updated the scripts that READ them, so every check naming a .md has been operating on a file that no longer exists. Repointed: ABI-FFI-README.md->ABI-FFI-README.adoc Three failure modes were in play across the estate, all fixed by the same change: * hard fail - 'check "X.md exists" "[ -f X.md ]"' can never pass * wrong score - '[ -f X.md ] && ((doc_score++))' silently scores lower * SILENT SKIP - 'if [ -f X.md ]; then ...greps... fi' skips the whole block, so the checks inside never run and the gate reports success by not checking at all Human-readable labels are repointed too, so failure messages name the file that is actually inspected. Where a script did 'git add ... X.md', that is fixed as well - it would have failed at release time. Only tokens whose .adoc twin exists in this repository were rewritten; anything without a twin was left untouched for separate triage. Found by an estate-wide sweep of 454 repos: 56 such checks across 18 repos. Same defect class as hyperpolymath/Axiom.jl#82. --- tests/validate_structure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/validate_structure.sh b/tests/validate_structure.sh index 0341141..a71cd6d 100755 --- a/tests/validate_structure.sh +++ b/tests/validate_structure.sh @@ -16,7 +16,7 @@ cd "$REPO_ROOT" [ -f README.adoc ] && pass "README.adoc present" || fail "README.adoc missing" [ -f LICENSE ] && pass "LICENSE present" || fail "LICENSE missing" [ -f SECURITY.md ] && pass "SECURITY.md present" || fail "SECURITY.md missing" -[ -f ABI-FFI-README.md ] && pass "ABI-FFI-README.md present" || fail "ABI-FFI-README.md missing" +[ -f ABI-FFI-README.adoc ] && pass "ABI-FFI-README.adoc present" || fail "ABI-FFI-README.adoc missing" # Required directories and key files [ -d engine ] && pass "engine/ directory present" || fail "engine/ directory missing" From cffed46a68c5f0bd07fca0b03792f68febc66c7e Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:05:35 +0100 Subject: [PATCH 2/2] fix(scripts): repair unsafe control flow flagged by Codacy Two defect classes, both verified empirically rather than inferred. 1. '[ cond ] && pass || fail' is NOT if/then/else. If the 'pass' branch returns non-zero, the 'fail' branch ALSO runs -- even though the condition was true. Demonstrated: pass() { echo ran; return 1; } [ -n yes ] && pass || fail -> BOTH pass() and fail() execute Rewritten as explicit if/then/else. 2. '((var++))' dies under 'set -e' when the counter is 0. Post-increment returns the OLD value as its exit status, so the first increment of a zero counter exits 1 and 'set -e' terminates the script. Demonstrated: set -e; score=0; ((score++)); echo reached -> script DIES before 'reached'; works fine from 1 onward That is precisely the first-document case a compliance script hits on every run. Rewritten as 'var=$((var + 1))'. Both classes are the same underlying trap as the duplicate-branch bug already fixed on asdf-tool-plugins#70 and developer-ecosystem#191: shell shorthand that reads like control flow but is not. Co-Authored-By: Claude Opus 5 --- tests/validate_structure.sh | 54 ++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/tests/validate_structure.sh b/tests/validate_structure.sh index a71cd6d..cb086d2 100755 --- a/tests/validate_structure.sh +++ b/tests/validate_structure.sh @@ -13,17 +13,53 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$REPO_ROOT" # Required root files -[ -f README.adoc ] && pass "README.adoc present" || fail "README.adoc missing" -[ -f LICENSE ] && pass "LICENSE present" || fail "LICENSE missing" -[ -f SECURITY.md ] && pass "SECURITY.md present" || fail "SECURITY.md missing" -[ -f ABI-FFI-README.adoc ] && pass "ABI-FFI-README.adoc present" || fail "ABI-FFI-README.adoc missing" +if [ -f README.adoc ]; then + pass "README.adoc present" +else + fail "README.adoc missing" +fi +if [ -f LICENSE ]; then + pass "LICENSE present" +else + fail "LICENSE missing" +fi +if [ -f SECURITY.md ]; then + pass "SECURITY.md present" +else + fail "SECURITY.md missing" +fi +if [ -f ABI-FFI-README.adoc ]; then + pass "ABI-FFI-README.adoc present" +else + fail "ABI-FFI-README.adoc missing" +fi # Required directories and key files -[ -d engine ] && pass "engine/ directory present" || fail "engine/ directory missing" -[ -f engine/test/runtests.jl ] && pass "engine/test/runtests.jl present" || fail "engine/test/runtests.jl missing" -[ -d node-alpha ] && pass "node-alpha/ directory present" || fail "node-alpha/ directory missing" -[ -d node-beta ] && pass "node-beta/ directory present" || fail "node-beta/ directory missing" -[ -d orchestrator ] && pass "orchestrator/ directory present" || fail "orchestrator/ directory missing" +if [ -d engine ]; then + pass "engine/ directory present" +else + fail "engine/ directory missing" +fi +if [ -f engine/test/runtests.jl ]; then + pass "engine/test/runtests.jl present" +else + fail "engine/test/runtests.jl missing" +fi +if [ -d node-alpha ]; then + pass "node-alpha/ directory present" +else + fail "node-alpha/ directory missing" +fi +if [ -d node-beta ]; then + pass "node-beta/ directory present" +else + fail "node-beta/ directory missing" +fi +if [ -d orchestrator ]; then + pass "orchestrator/ directory present" +else + fail "orchestrator/ directory missing" +fi # GitHub workflows — require at least 3 WORKFLOW_COUNT=0