SOL-BASHRS-001 // bashrs
Zero-Injection POSIX CI Gate Script
Transpile and lint a strict POSIX deployment gate with quoted expansions, explicit trap cleanup, and deterministic exit codes.
Measured delta: 100% SEC001 unquoted rm -rf eliminated; 0 temp-dir leaks
Live bashrs Shell Lint-Breaker Playground (WASM)
Status: Loading bashrs WASM...
Receipt: --
Diagnostics appear here once bashrs WASM mounts.
Before (Failing Anti-Pattern)
#!/bin/bash rm -rf $WORK_DIR/* echo "gate: ok" > $WORK_DIR/status.txt
After (Verified Code)
#!/usr/bin/env bash
set -euo pipefail
WORK_DIR="$(mktemp -d)"
cleanup() { rm -rf -- "${WORK_DIR:?}"; }
trap cleanup EXIT
printf '%s\n' "gate: ok" > "${WORK_DIR}/status.txt"
test -s "${WORK_DIR}/status.txt"
Verification Contract
schema: bashrs.contract.v1 rules: - SEC001: no-unquoted-rm-rf - DET002: deterministic-exit-codes - POSIX004: trap-cleanup-required max_warnings: 0
Verified CLI Command & Output
$ bashrs lint --strict ci-gate.sh bashrs lint: 0 errors, 0 warnings (SEC001..POSIX004 PASS)