Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core/blob/main/scripts/agent-preflight.sh # aien-sovereign-core Autonomous sovereign intelligence engine and runtime core for NVIDIA DGX Spark Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-sovereign-core / scripts / agent-preflight.sh` 71 lines · 2578 bytes Raw Blame History 1 #!/usr/bin/env bash 2 set -eo pipefail 3 4 echo "============================================================" 5 echo " AIEN Sovereign Agent Preflight Verification Harness " 6 echo "============================================================" 7 8 FAILED=0 9 10 # Step 1: Branch Guard (Zero direct commits to main) 11 echo -n "[1/5] Verifying Branch Isolation... " 12 CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown") 13 if [ "$CURRENT_BRANCH" = "main" ]; then 14 echo "FAILED" 15 echo "Error: Cannot commit directly to main. Create a feature branch (e.g. feat/, fix/)." 16 FAILED=1 17 else 18 echo "PASSED (Branch: $CURRENT_BRANCH)" 19 fi 20 21 # Step 2: Zero Disk Secrets Audit 22 echo -n "[2/5] Auditing Zero Disk Secrets... " 23 SECRET_FILES=$(find . -maxdepth 3 -name ".env*" -o -name "*.key" -o -name "*secret*" -o -name "*.pem" 2>/dev/null | grep -v ".git" | grep -v "target" || true) 24 if [ -n "$SECRET_FILES" ]; then 25 echo "FAILED" 26 echo "Error: Stray plaintext secret files detected on disk:" 27 echo "$SECRET_FILES" 28 FAILED=1 29 else 30 echo "PASSED (Zero disk secrets detected)" 31 fi 32 33 # Step 3: Unslop and Sovereign Voice Audit on Staged / Working Changes 34 echo -n "[3/5] Verifying Unslop & Anti-Slop Discipline... " 35 DASH_VIOLATIONS=$(git diff HEAD -- ':(exclude)*.lock' ':(exclude)*.svg' ':(exclude)*.bin' 2>/dev/null | grep -E '^\+[^+]' | grep -E '(—|–)' | grep -v "replace" | grep -v "contains" | grep -v "ZERO EM DASHES" | grep -v "forbidden" | grep -v "assert\!" || true) 36 if [ -n "$DASH_VIOLATIONS" ]; then 37 echo "FAILED" 38 echo "Error: Prohibited em dash or en dash characters introduced in git diff:" 39 echo "$DASH_VIOLATIONS" 40 FAILED=1 41 else 42 echo "PASSED (Zero em/en dashes in diff)" 43 fi 44 45 # Step 4: Test Suite Verification 46 echo "[4/5] Running Workspace Test Suite..." 47 if cargo test --workspace; then 48 echo "PASSED (100% test pass)" 49 else 50 echo "FAILED (Test suite failed)" 51 FAILED=1 52 fi 53 54 # Step 5: Vulnerability & Advisory Audit 55 echo -n "[5/5] Checking RustSec Vulnerability Advisories... " 56 if cargo audit 2>/dev/null; then 57 echo "PASSED (0 advisories)" 58 else 59 echo "PASSED WITH WARNINGS (Check cargo audit logs)" 60 fi 61 62 echo "============================================================" 63 if [ "$FAILED" -eq 0 ]; then 64 echo " ✓ PREFLIGHT VERIFICATION COMPLETE: Ready for PR Creation" 65 echo "============================================================" 66 exit 0 67 else 68 echo " ✗ PREFLIGHT FAILED: Resolve defects before opening PR" 69 echo "============================================================" 70 exit 1 71 fi