Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions scripts/validate-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ check_file_exists "AUDIT.adoc" "Release audit gate"
# Directories
check_dir_exists ".machine_readable" "Machine-readable metadata"
check_dir_exists ".github" "GitHub community metadata"
check_dir_exists "src/interface/abi" "Idris2 ABI definitions"
check_dir_exists "src/interface/Abi" "Idris2 ABI definitions"
check_dir_exists "src/interface/ffi" "Zig FFI implementation"
check_dir_exists "src/interface/generated/abi" "Generated C headers"
check_dir_exists "docs" "Documentation"
Expand Down Expand Up @@ -136,14 +136,12 @@ REQUIRED_WORKFLOWS=(
"quality.yml"
"mirror.yml"
"instant-sync.yml"
"guix-nix-policy.yml"
"rsr-antipattern.yml"
"security-policy.yml"
"wellknown-enforcement.yml"
"workflow-linter.yml"
"npm-bun-blocker.yml"
"ts-blocker.yml"
"scorecard-enforcer.yml"
"runtime-policy.yml"
"scorecard.yml"
Comment thread
hyperpolymath marked this conversation as resolved.
"secret-scanner.yml"
)

Expand Down Expand Up @@ -190,9 +188,9 @@ log_info "Phase 4: Idris2 ABI and Zig FFI source files"
echo ""

# Idris2 ABI files
check_file_exists "src/interface/abi/Types.idr" "Core type definitions"
check_file_exists "src/interface/abi/Layout.idr" "Memory layout specifications"
check_file_exists "src/interface/abi/Foreign.idr" "FFI foreign declarations"
check_file_exists "src/interface/Abi/Types.idr" "Core type definitions"
check_file_exists "src/interface/Abi/Layout.idr" "Memory layout specifications"
check_file_exists "src/interface/Abi/Foreign.idr" "FFI foreign declarations"

# Zig FFI files
check_file_exists "src/interface/ffi/build.zig" "Zig build configuration"
Expand Down
18 changes: 16 additions & 2 deletions tests/aspect_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ bold "Aspect 1: SPDX license headers"

MISSING_SPDX=0
while IFS= read -r -d '' f; do
if ! head -5 "$f" | grep -q "SPDX-License-Identifier"; then
# Window widened from 5 to 15 lines, 2026-07-29. src/interface/ffi/src/main.zig
# carries SPDX-License-Identifier: MPL-2.0 on line SIX, under a five-line
# descriptive banner -- a perfectly licensed file reported as unlicensed
# because the header sat one line outside the window. The tempting "fix" is
# to add a second SPDX line to a file that already has one; the actual defect
# is the window.
if ! head -15 "$f" | grep -q "SPDX-License-Identifier"; then
warn "Missing SPDX header: $f"
MISSING_SPDX=$((MISSING_SPDX + 1))
fi
Expand All @@ -77,7 +83,15 @@ else
fi

# Coq/Lean dangerous patterns
DANGEROUS_PROOF=$(grep -rn '\bAdmitted\b\|\bsorry\b\|\bunsafeCoerce\b\|\bObj\.magic\b' src/ verification/ 2>/dev/null | grep -v "test" | grep -v "comment" || true)
DANGEROUS_PROOF=$(
for f in $(find src verification -type f \
\( -name '*.v' -o -name '*.lean' -o -name '*.agda' \
-o -name '*.idr' -o -name '*.thy' -o -name '*.rs' -o -name '*.zig' \) 2>/dev/null); do
awk -f tests/lib/strip-proof-comments.awk "$f" 2>/dev/null \
| grep -nE '\bAdmitted\b|\bsorry\b|\bunsafeCoerce\b|\bObj\.magic\b' \
| sed "s|^|$f:|"
done || true
)
Comment thread
hyperpolymath marked this conversation as resolved.
if [ -n "$DANGEROUS_PROOF" ]; then
fail "Dangerous proof patterns found:"
echo "$DANGEROUS_PROOF" | head -5
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/template_instantiation_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ find "$TEST_REPO_PATH" -type f \
sed -i "s|$placeholder|$value|g" "$file"
fi
done
' _ "$file"
' _ {} \;

log_pass "All placeholder tokens replaced"

Expand Down
28 changes: 28 additions & 0 deletions tests/lib/strip-proof-comments.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Strip comments from proof/source files before scanning for dangerous constructs.
#
# Line-based filtering is not enough: a Coq (* ... *) or Lean /- ... -/ block
# spans lines, and a CONTINUATION line carries no marker of its own. Measured
# 2026-07-29: verification/proofs/coq/TypeSafety.v:6 ("All proofs must be
# complete - NO Admitted allowed.") is line 6 of a block comment and was
# reported as a dangerous construct -- i.e. the repo was failed for DOCUMENTING
# that it forbids Admitted.
#
# Handles: (* *) /- -/ {- -} /* */ plus the line forms -- and //
BEGIN { inblk = 0 }
{
line = $0; out = ""; i = 1; n = length(line)
while (i <= n) {
two = substr(line, i, 2)
if (inblk) {
if (two == close_tok) { inblk = 0; i += 2; continue }
i++; continue
}
if (two == "(*") { inblk = 1; close_tok = "*)"; i += 2; continue }
if (two == "/-") { inblk = 1; close_tok = "-/"; i += 2; continue }
if (two == "{-") { inblk = 1; close_tok = "-}"; i += 2; continue }
if (two == "/*") { inblk = 1; close_tok = "*/"; i += 2; continue }
if (two == "--" || two == "//") { break }
out = out substr(line, i, 1); i++
Comment thread
hyperpolymath marked this conversation as resolved.
}
print out
}
Loading