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
aien-sovereign-core-mv / tools / aien-local-ci / tests / pipeline_mutants.sh
| 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 | # pipeline_mutants.sh: each mutant undoes one part of the publish trust-anchor rule (aien-receipts 264da364 F2) or of |
| 18 | # the alpha HELD_PUBLISH_BLOCKED hold in a copy of pipeline.sh; pipeline_test.sh must fail on every one. A mutant whose edit does not apply is an error, not |
| 19 | # a kill. Offline, same fakes as pipeline_test.sh. |
| 20 | # bash tools/aien-local-ci/tests/pipeline_mutants.sh |
| 21 | set -uo pipefail |
| 22 | HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) |
| 23 | SRC=$HERE/../pipeline.sh |
| 24 | T=$(mktemp -d) |
| 25 | trap 'rm -rf "$T"' EXIT |
| 26 | killed=0 survived=0 broken=0 |
| 27 | |
| 28 | # NAME|FROM|TO: literal (fixed-string) replacement, exactly one occurrence. |
| 29 | mutants=( |
| 30 | 'no-require|v=$(verify "$tmp" "$repo" "$sha" "$keylist" "$require")|v=$(verify "$tmp" "$repo" "$sha" "$keylist")' |
| 31 | 'own-list|show "$2^1:.aien/always"|show "$2:.aien/always"' |
| 32 | 'anchor-fail-open|if ! require=$(anchor_gates "$clone" "$sha"); then|if ! require=$(anchor_gates "$clone" "$sha" || true); then' |
| 33 | 'held-ignored|if [[ $purl =~ ^blocked-|if [[ $purl =~ ^never-' |
| 34 | 'held-every-round|if [[ $(cat "$HELD_DIR/$repo" 2>/dev/null) != "$held" ]]; then|if true; then' |
| 35 | 'held-url-only|held="$best_sha $purl"|held="$purl"' |
| 36 | ) |
| 37 | |
| 38 | for m in "${mutants[@]}"; do |
| 39 | IFS='|' read -r name from to <<< "$m" |
| 40 | out=$T/$name.sh |
| 41 | s=$(< "$SRC") |
| 42 | rest=${s#*"$from"} |
| 43 | if [[ $s != *"$from"* || $rest == *"$from"* ]]; then |
| 44 | broken=$((broken + 1)); echo "BROKEN $name (edit does not apply once)"; continue |
| 45 | fi |
| 46 | printf '%s\n' "${s/"$from"/"$to"}" > "$out" |
| 47 | if PIPELINE_UNDER_TEST=$out bash "$HERE/pipeline_test.sh" > "$T/$name.log" 2>&1; then |
| 48 | survived=$((survived + 1)); echo "SURVIVED $name" |
| 49 | else |
| 50 | killed=$((killed + 1)); echo "KILLED $name: $(grep -c '^FAIL ' "$T/$name.log") failing checks, first: $(grep -m1 '^FAIL ' "$T/$name.log")" |
| 51 | fi |
| 52 | done |
| 53 | echo "pipeline_mutants: $killed killed, $survived survived, $broken broken" |
| 54 | [[ $survived == 0 && $broken == 0 ]] |