aegis-runtime-mv
Native Rust agent runtime: Axum WebSocket/SSE/REST gateway, heartbeat scheduler, dependency-aware task workflow, SQLite storage. Attachment of AienOS. Pre-alpha.
Brought by drakestapleton
aegis-runtime-mv / scripts / agent-preflight.sh
| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | echo "=== AEGIS Preflight Verification ===" |
| 5 | |
| 6 | # 1. Branch Isolation |
| 7 | BRANCH=$(git rev-parse --abbrev-ref HEAD) |
| 8 | if [ "$BRANCH" = "main" ]; then |
| 9 | echo "[-] FAILED: Direct commits to 'main' branch are strictly prohibited." |
| 10 | echo " Create a feature branch (e.g. feat/..., fix/..., perf/...) first." |
| 11 | exit 1 |
| 12 | fi |
| 13 | echo "[+] PASSED: Branch isolation confirmed ($BRANCH)." |
| 14 | |
| 15 | # 2. Zero Disk Secrets Check |
| 16 | if find . -maxdepth 3 -name ".env*" -not -path "./.git/*" | grep -q .; then |
| 17 | echo "[-] FAILED: Found plaintext .env file on disk. Hardware TPM vault required." |
| 18 | exit 1 |
| 19 | fi |
| 20 | echo "[+] PASSED: Zero disk secrets confirmed (Hardware TPM vault active)." |
| 21 | |
| 22 | # 3. Unslop Standard (Zero em dashes or en dashes) |
| 23 | DASH_VIOLATIONS=$(git diff HEAD | grep -E '^\+[^+]' | grep -v 'assert!' | grep -v 'replace' | grep -v 'contains' | grep -P '[\x{2014}\x{2013}]' || true) |
| 24 | if [ -n "$DASH_VIOLATIONS" ]; then |
| 25 | echo "[-] FAILED: Found prohibited em dash or en dash in git diff:" |
| 26 | echo "$DASH_VIOLATIONS" |
| 27 | exit 1 |
| 28 | fi |
| 29 | echo "[+] PASSED: Unslop standard verified (zero em dashes and zero en dashes)." |
| 30 | |
| 31 | # 4. Cargo Tests |
| 32 | echo "[*] Running cargo test..." |
| 33 | cargo test --verbose |
| 34 | |
| 35 | echo "=== ALL AEGIS PREFLIGHT CHECKS PASSED ===" |