Files
aevolution/tools/ci/ci-paths-check.sh
T
dingoandClaude Opus 5.5 8fbe093cc8 Implement M9.6 narrow secure dev-session protocol
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>
2026-10-01 18:53:55 -04:00

56 lines
3.2 KiB
Bash

#!/usr/bin/env bash
# Offline regression for tools/ci/ci-paths.sh (review M8 P2) in a disposable Git
# repository: multi-commit pushes ending in documentation, missing and unknown bases,
# pull requests, manual dispatch, and changes to only a check script. Uncertainty
# must run validation. Run by the deploy suite before it decides anything.
set -euo pipefail
script="$(cd "$(dirname "$0")" && pwd)/ci-paths.sh"
repo="$(mktemp -d /tmp/evo-ci-paths.XXXXXXXX)"
trap 'rm -rf -- "$repo"' EXIT
cd "$repo"
git init -q
git config user.email ci@example.invalid
git config user.name ci
mkdir -p src docs tools/ci
echo base > src/a.cpp; echo base > docs/a.md; echo base > tools/ci/dr-check.sh
git add .; git commit -qm base
base="$(git rev-parse HEAD)"
echo change >> src/a.cpp; git commit -qam implementation
echo change >> docs/a.md; git commit -qam documentation
docs_only_base="$(git rev-parse HEAD~1)"
failures=0
expect() { # expect <label> <0 run|1 skip> <env...> -- <suite>
local label="$1" want="$2"; shift 2
local envs=()
while [ "$1" != -- ]; do envs+=("$1"); shift; done
shift
local got=0
env -u GITHUB_EVENT_BEFORE -u GITHUB_EVENT_NAME -u CI_EVENT -u CI_BEFORE -u CI_PR_BASE \
"${envs[@]}" bash "$script" "$1" || got=$?
if [ "$got" = "$want" ]; then echo "ok $label"; else echo "FAIL $label: exit $got, wanted $want"; failures=$((failures + 1)); fi
}
expect "push: code then docs runs checks" 0 CI_EVENT=push "CI_BEFORE=$base" -- checks
expect "push: docs-only commit skips checks" 1 CI_EVENT=push "CI_BEFORE=$docs_only_base" -- checks
expect "push: no before SHA runs" 0 CI_EVENT=push -- checks
expect "push: all-zero before (new branch) runs" 0 CI_EVENT=push CI_BEFORE=0000000000000000000000000000000000000000 -- checks
expect "push: unknown, unfetchable base runs" 0 CI_EVENT=push CI_BEFORE=1111111111111111111111111111111111111111 -- checks
expect "pull request: base diff runs checks" 0 CI_EVENT=pull_request "CI_PR_BASE=$base" -- checks
expect "pull request: no base runs" 0 CI_EVENT=pull_request -- deploy
expect "manual dispatch always runs" 0 CI_EVENT=workflow_dispatch "CI_BEFORE=$docs_only_base" -- checks
expect "local run (no event) runs" 0 -- postgres
echo change >> tools/ci/dr-check.sh; git commit -qam dr-script
script_base="$(git rev-parse HEAD~1)"
expect "push: only dr-check.sh changed runs postgres" 0 CI_EVENT=push "CI_BEFORE=$script_base" -- postgres
expect "push: only dr-check.sh changed skips image" 1 CI_EVENT=push "CI_BEFORE=$script_base" -- image
# Client dependency updates must select the isolated client gate.
mkdir -p tools
client_base="$(git rev-parse HEAD)"
echo pin > tools/sdl3-pin.cmake; git add .; git commit -qm client-pin
expect "push: SDL pin runs client" 0 CI_EVENT=push "CI_BEFORE=$client_base" -- client
# A TLS dependency update must select the isolated network gate, not only the image.
network_base="$(git rev-parse HEAD)"
echo pin > tools/mbedtls-pin.cmake; git add .; git commit -qm network-pin
expect "push: Mbed TLS pin runs network" 0 CI_EVENT=push "CI_BEFORE=$network_base" -- network
expect "push: Mbed TLS pin skips deploy" 1 CI_EVENT=push "CI_BEFORE=$network_base" -- deploy
[ "$failures" = 0 ] && echo "ci path selection fixtures passed" || { echo "$failures fixture(s) failed"; exit 1; }