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-mv/blob/main/scripts/agent-preflight.sh # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. 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-mv / scripts / agent-preflight.sh` 96 lines · 3930 bytes Raw Blame History 1 #!/usr/bin/env bash 2 # SPDX-License-Identifier: Apache-2.0 3 # Copyright 2026 Drake Stapleton (AIEN / aien-dev) 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 set -eo pipefail 18 19 echo "============================================================" 20 echo " AIEN Sovereign Agent Preflight Verification Harness " 21 echo "============================================================" 22 23 FAILED=0 24 25 # Step 1: Branch Guard (Zero direct commits to main) 26 echo -n "[1/5] Verifying Branch Isolation... " 27 if bash "$(dirname "$0")/preflight-branch-guard.sh"; then :; else FAILED=1; fi 28 29 # Step 2: Zero Disk Secrets Audit 30 echo -n "[2/5] Auditing Zero Disk Secrets... " 31 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) 32 if [ -n "$SECRET_FILES" ]; then 33 echo "FAILED" 34 echo "Error: Stray plaintext secret files detected on disk:" 35 echo "$SECRET_FILES" 36 FAILED=1 37 else 38 echo "PASSED (Zero disk secrets detected)" 39 fi 40 41 # Step 3: Unslop and Sovereign Voice Audit on the branch (committed + working changes) 42 echo -n "[3/5] Verifying Unslop & Anti-Slop Discipline... " 43 # Diff against the merge base with main so committed branch work is audited, 44 # not only uncommitted edits. Falls back to HEAD when no main ref exists. 45 DIFF_BASE=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null || echo HEAD) 46 DASH_VIOLATIONS=$(git diff "$DIFF_BASE" --':(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) 47 if [ -n "$DASH_VIOLATIONS" ]; then 48 echo "FAILED" 49 echo "Error: Prohibited em dash or en dash characters introduced in git diff:" 50 echo "$DASH_VIOLATIONS" 51 FAILED=1 52 else 53 echo "PASSED (Zero em/en dashes in diff)" 54 fi 55 56 # Step 4: Test Suite Verification 57 # Runs one stamped job per crate through the shared aien-proof board: crates 58 # whose code and local dependencies are unchanged replay their stamp, identical 59 # runs from other agents are joined, and real runs pass the CPU, memory, and GPU 60 # gates. Set AIEN_PROOF_OFF=1 to fall back to a plain workspace test. 61 echo "[4/5] Running Workspace Test Suite..." 62 if [ "${AIEN_PROOF_OFF:-0}" = "1" ]; then 63 TEST_CMD=(cargo test --workspace) 64 elif command -v aien-proof >/dev/null 2>&1; then 65 TEST_CMD=(aien-proof crates) 66 else 67 TEST_CMD=(cargo run -q -p aien-proof -- crates) 68 fi 69 if "${TEST_CMD[@]}"; then 70 echo "PASSED (100% test pass)" 71 else 72 echo "FAILED (Test suite failed)" 73 FAILED=1 74 fi 75 76 # Step 5: Vulnerability & Advisory Audit 77 echo -n "[5/5] Checking RustSec Vulnerability Advisories... " 78 if ! cargo audit --version >/dev/null 2>&1; then 79 echo "SKIPPED (cargo-audit not installed)" 80 elif cargo audit; then 81 echo "PASSED (No vulnerabilities; review any warnings above)" 82 else 83 echo "FAILED (Vulnerabilities reported above)" 84 FAILED=1 85 fi 86 87 echo "============================================================" 88 if [ "$FAILED" -eq 0 ]; then 89 echo " ✓ PREFLIGHT VERIFICATION COMPLETE: Ready for PR Creation" 90 echo "============================================================" 91 exit 0 92 else 93 echo " ✗ PREFLIGHT FAILED: Resolve defects before opening PR" 94 echo "============================================================" 95 exit 1 96 fi