interplane.Get Omega
Read in your language

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

branch main Branches Tags History

aien-sovereign-core-mv / scripts / install-hooks.sh

48 lines · 1568 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
17set -euo pipefail
18
19ROOT_DIR="$(git rev-parse --show-toplevel)"
20HOOKS_DIR="$ROOT_DIR/.git/hooks"
21
22mkdir -p "$HOOKS_DIR"
23
24cat << 'HOOK_EOF' > "$HOOKS_DIR/pre-commit"
25#!/usr/bin/env bash
26set -euo pipefail
27
28# Sovereign Pre-Commit Hook: Enforcing Security Invariants & Advisory Styling
29if ! git diff --cached --quiet; then
30 TMP_DIFF="$(mktemp --suffix=.diff)"
31 git diff --cached > "$TMP_DIFF"
32
33 if command -v spark-inquisitor >/dev/null 2>&1; then
34 spark-inquisitor audit --diff "$TMP_DIFF" --advisory-style
35 STATUS=$?
36 rm -f "$TMP_DIFF"
37 if [ $STATUS -ne 0 ]; then
38 echo "Pre-commit hook failed: critical security invariants violated (plaintext secrets or telemetry)."
39 exit 1
40 fi
41 else
42 rm -f "$TMP_DIFF"
43 fi
44fi
45HOOK_EOF
46
47chmod +x "$HOOKS_DIR/pre-commit"
48echo "Sovereign pre-commit hook installed successfully in $HOOKS_DIR/pre-commit"