Add protocol v1: versioned, bounded frames (Hello, Welcome, Intent, IntentResult, environment/organism views, Close) carrying session, epoch and commit watermark, with an explicit little-endian canonical codec, a header-first FrameReader, seeded mutation tests and a libFuzzer target. SessionAdmission enforces world/region scope, grant lifetime and skew, single-use grants, one session per subject, epoch, replay, tick window and per-session rate. Dev identity is a 108-byte HMAC-SHA256 grant (PSA) that cannot be created or verified outside the dev environment. Transport security is TLS 1.3 only via pinned Mbed TLS 4.1.1 LTS with TLS 1.2, DTLS, tickets and PSK compiled out, AEAD suites, ECDHE groups and a pinned dev CA. Opt-in EVO_BUILD_NETWORK, new network CI suite. Sockets and region integration follow in M9.7. ADR-0082 records the decision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62 lines
2.6 KiB
Bash
Executable File
62 lines
2.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Decides whether a CI suite must run: exit 0 = run, exit 1 = nothing relevant changed.
|
|
#
|
|
# The comparison base comes from the event (review M8 P2), never from HEAD^ alone:
|
|
# - push: CI_BEFORE (the push's `before` SHA), so every commit of a multi-commit push
|
|
# counts, not just the last;
|
|
# - pull_request: CI_PR_BASE (the base SHA), diffed against the checked-out merge;
|
|
# - workflow_dispatch, schedule, a local run or any other event: always run.
|
|
# A missing, all-zero or unfetchable base, or any git failure, also runs the suite:
|
|
# uncertainty never skips validation. tools/ci/ci-paths-check.sh tests this offline.
|
|
set -euo pipefail
|
|
|
|
suite=${1:?suite required}
|
|
event="${CI_EVENT:-${GITHUB_EVENT_NAME:-}}"
|
|
case "$event" in
|
|
push) base="${CI_BEFORE:-${GITHUB_EVENT_BEFORE:-}}" ;;
|
|
pull_request) base="${CI_PR_BASE:-}" ;;
|
|
*) exit 0 ;;
|
|
esac
|
|
if [[ ! "$base" =~ ^[0-9a-f]{40}$ || "$base" == 0000000000000000000000000000000000000000 ]]; then
|
|
exit 0
|
|
fi
|
|
if ! git cat-file -e "$base^{commit}" 2> /dev/null; then
|
|
git fetch --no-tags --quiet --depth=1 origin "$base" > /dev/null 2>&1 || exit 0
|
|
git cat-file -e "$base^{commit}" 2> /dev/null || exit 0
|
|
fi
|
|
if ! files=$(git diff --name-only "$base" HEAD 2> /dev/null); then
|
|
exit 0
|
|
fi
|
|
|
|
# Every suite runs when the workflow or this selector changes.
|
|
common='\.gitea/workflows/|tools/ci/ci-paths\.sh'
|
|
native='CMakeLists\.txt|CMakePresets\.json|cmake/|include/|src/|apps/'
|
|
postgres_tools='migrations/|tools/prepare-postgres\.sh|tools/migrate-postgres\.sh|tools/backup/|tools/ci/postgres-check\.sh|tools/ci/backup-check\.sh|tools/ci/dr-check\.sh|tools/ci/upgrade-check\.sh'
|
|
case "$suite" in
|
|
client)
|
|
pattern="$common|$native|experiments/client/|tools/prepare-sdl3\\.cmake|tools/sdl3-pin\\.cmake|deploy/docker/Dockerfile"
|
|
;;
|
|
network)
|
|
pattern="$common|$native|tests/network_|tests/fuzz/dev_session|third_party/mbedtls/|tools/prepare-mbedtls\.cmake|tools/mbedtls-pin\.cmake|deploy/docker/Dockerfile"
|
|
;;
|
|
checks|tsan|ecs)
|
|
pattern="$common|$native|tests/|experiments/|tools/ci/linux-check\.sh|tools/ci/tsan-profile\.mjs|deploy/docker/Dockerfile"
|
|
;;
|
|
postgres|postgres-tools)
|
|
pattern="$common|$native|tests/|$postgres_tools|deploy/docker/Dockerfile"
|
|
;;
|
|
deploy)
|
|
pattern="$common|deploy/|tools/ops/|tools/backup/|tools/ci/deploy-policy-check\.py|tools/ci/monitoring-check\.sh|tools/ci/ops-lib-check\.sh"
|
|
;;
|
|
server-image)
|
|
pattern="$common|$native|migrations/|tools/prepare-postgres\.sh|tools/ci/server-image-smoke\.sh|deploy/docker/Dockerfile"
|
|
;;
|
|
image)
|
|
pattern="$common|$native|tests/|deploy/docker/Dockerfile"
|
|
;;
|
|
*)
|
|
exit 0
|
|
;;
|
|
esac
|
|
grep -Eq "^($pattern)" <<< "$files"
|