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

Zero-Injection POSIX CI Gate Script receipt poster
Verified CLI Version
bashrs 7.5.0 (commit: b634edc7642354d208deb431a9a6f2c0d76616b1)
Receipt SHA-256
9715e0bd44708dd7003b3fc291f690f5ad43086c736657468f68ae0bf90db4e1

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)