interplane.Get Omega
Read in your language

aien-protocols-mv

Canonical specifications, wire protocols, and schemas for the AIEN sovereign ecosystem

Brought by drakestapleton

branch main Branches Tags History

aien-protocols-mv / .github / workflows / aien-verification.yml

210 lines · 9273 bytes Raw Blame History
1# AIEN: GitHub-hosted checks and Alpha verification (ADR 0033 Decision 11, inventory contract C5).
2#
3# Drake 2026-10-24: nothing on GitHub gates a merge; main requires no status check. The Spark
4# qualifies Alpha builds instead: the local pipeline pushes annotated tags alpha/YYYYMMDD.N.
5# AIEN Checks (pull_request, push to main): advisory. For enrolled repos (.aien/verify.pub on
6# origin/main) the portable smoke set named at origin/main. No crumb step: Crumbs are retired
7# from the active workflow (DRA-97, 2026-11-07).
8# AIEN Alpha (push of an alpha/* tag): the tagged commit must be on main; its signed Spark bundle
9# from aien-receipts must verify (--require-full) against the trust anchors on origin/main.
10# GitHub-hosted compute builds only the pinned verifier tools, never this repository's code.
11name: AIEN
12
13on:
14 pull_request:
15 push:
16 branches: [main]
17 tags: ['alpha/*']
18
19permissions:
20 contents: read
21
22jobs:
23 checks:
24 name: AIEN Checks
25 if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
26 runs-on: ubuntu-latest
27 timeout-minutes: 30
28 env:
29 REPO_SLUG: aien-dev/aien-protocols
30 AIEN_TEST_PIN: a51042b61b87355c0850ef82ba409a46e153a1ff
31 RECEIPTS_RAW: https://raw.githubusercontent.com/aien-dev/aien-receipts/main
32 steps:
33 - name: Checkout the head under test
34 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
35 with:
36 fetch-depth: 0
37
38 - name: Resolve the base ref
39 id: ids
40 run: |
41 git fetch -q origin main
42 echo "base=$(git rev-parse origin/main)" >> "$GITHUB_OUTPUT"
43 echo "base (trust anchors): $(git rev-parse origin/main)"
44
45 - name: "Enrollment from the base ref (never from the head under test)"
46 id: anchors
47 run: |
48 if git cat-file -e "${{ steps.ids.outputs.base }}:.aien/verify.pub" 2>/dev/null; then
49 echo "enrolled=true" >> "$GITHUB_OUTPUT"
50 else
51 echo "enrolled=false" >> "$GITHUB_OUTPUT"
52 echo "not enrolled: no .aien/verify.pub on the base ref; the portable smoke set is skipped"
53 fi
54
55 - name: Install Stable Rust Toolchain (for the pinned aien-test build)
56 uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable branch head 2026-10-26
57 if: steps.anchors.outputs.enrolled == 'true'
58 with:
59 components: rustfmt
60
61 - name: Checkout the pinned aien-test source (aien-sovereign-core @ ${{ env.AIEN_TEST_PIN }})
62 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
63 if: steps.anchors.outputs.enrolled == 'true'
64 with:
65 repository: aien-dev/aien-sovereign-core
66 ref: ${{ env.AIEN_TEST_PIN }}
67 path: .aien-test-src
68
69 - name: Move the pinned source outside the candidate Cargo configuration
70 if: steps.anchors.outputs.enrolled == 'true'
71 run: mv .aien-test-src "$RUNNER_TEMP/aien-test-src"
72
73 # Cache dependencies only, never verifier executables or candidate-controlled target output.
74 - name: Cache the pinned aien-test dependencies
75 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
76 if: steps.anchors.outputs.enrolled == 'true'
77 with:
78 path: |
79 ~/.cargo/registry
80 ~/.cargo/git
81 key: aien-test-isolated-v1-${{ runner.os }}-${{ env.AIEN_TEST_PIN }}
82
83 - name: Build aien-test outside the tree under test
84 if: steps.anchors.outputs.enrolled == 'true'
85 run: |
86 cd "$RUNNER_TEMP/aien-test-src"
87 cargo build --release -p aien-test --target-dir "$RUNNER_TEMP/aien-test-target"
88 mkdir -p "$RUNNER_TEMP/bin" && cp "$RUNNER_TEMP/aien-test-target/release/aien-test" "$RUNNER_TEMP/bin/aien-test"
89 echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"
90 cd "$GITHUB_WORKSPACE"
91 git status --porcelain --untracked-files=normal
92
93 - name: Portable smoke set (gates whose requires is only portable, named at the base ref)
94 if: steps.anchors.outputs.enrolled == 'true'
95 run: |
96 base="${{ steps.ids.outputs.base }}"
97 names=$(for f in $(git ls-tree -r --name-only "$base" -- tests/gates | grep '\.gate$'); do
98 git show "$base:$f" | awk '
99 /^gate:/ {g=$2}
100 /^requires:/ {inr=1; next}
101 inr && /^ - / { if ($2 != "portable") other=1; next }
102 /^[a-z]/ {inr=0}
103 END { if (g != "" && !other) print g }'
104 done)
105 echo "portable smoke set: $(echo $names)"
106 mkdir -p "$RUNNER_TEMP/evidence"
107 fail=0
108 for g in $names; do
109 echo "::group::$g"
110 if timeout 600 aien-test run "$g" --evidence-dir "$RUNNER_TEMP/evidence"; then echo "$g: PASS"; else echo "::error::$g: not PASS"; fail=1; fi
111 echo "::endgroup::"
112 done
113 exit $fail
114
115 alpha:
116 name: AIEN Alpha
117 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/alpha/')
118 runs-on: ubuntu-latest
119 timeout-minutes: 30
120 env:
121 REPO_SLUG: aien-dev/aien-protocols
122 AIEN_TEST_PIN: a51042b61b87355c0850ef82ba409a46e153a1ff
123 RECEIPTS_RAW: https://raw.githubusercontent.com/aien-dev/aien-receipts/main
124 steps:
125 - name: Checkout the tagged commit
126 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
127 with:
128 fetch-depth: 0
129
130 - name: The tagged commit must be on main
131 id: ids
132 run: |
133 sha=$(git rev-parse "${GITHUB_REF}^{commit}")
134 git fetch -q origin main
135 if ! git merge-base --is-ancestor "$sha" origin/main; then
136 echo "::error::${GITHUB_REF#refs/tags/} points at $sha, which is not on main"
137 exit 1
138 fi
139 echo "sha=$sha" >> "$GITHUB_OUTPUT"
140 echo "tag ${GITHUB_REF#refs/tags/} -> $sha (on main)"
141
142 - name: Trust anchors from origin/main
143 run: |
144 mkdir -p "$RUNNER_TEMP/anchors"
145 if ! git show "origin/main:.aien/verify.pub" > "$RUNNER_TEMP/anchors/verify.pub" 2>/dev/null; then
146 echo "::error::.aien/verify.pub is not on origin/main: no trusted key, nothing can be verified."
147 exit 1
148 fi
149 git show "origin/main:.aien/always" > "$RUNNER_TEMP/anchors/always" 2>/dev/null || : > "$RUNNER_TEMP/anchors/always"
150 echo "verify.pub (origin/main): $(cat "$RUNNER_TEMP/anchors/verify.pub")"
151
152 - name: Install Stable Rust Toolchain (for the pinned aien-test build)
153 uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable branch head 2026-10-26
154 with:
155 components: rustfmt
156
157 - name: Checkout the pinned aien-test source (aien-sovereign-core @ ${{ env.AIEN_TEST_PIN }})
158 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
159 with:
160 repository: aien-dev/aien-sovereign-core
161 ref: ${{ env.AIEN_TEST_PIN }}
162 path: .aien-test-src
163
164 - name: Move the pinned source outside the candidate Cargo configuration
165 run: mv .aien-test-src "$RUNNER_TEMP/aien-test-src"
166
167 # Cache dependencies only, never verifier executables or candidate-controlled target output.
168 - name: Cache the pinned aien-test dependencies
169 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
170 with:
171 path: |
172 ~/.cargo/registry
173 ~/.cargo/git
174 key: aien-test-isolated-v1-${{ runner.os }}-${{ env.AIEN_TEST_PIN }}
175
176 - name: Build aien-test outside the tree under test
177 run: |
178 cd "$RUNNER_TEMP/aien-test-src"
179 cargo build --release -p aien-test --target-dir "$RUNNER_TEMP/aien-test-target"
180 mkdir -p "$RUNNER_TEMP/bin" && cp "$RUNNER_TEMP/aien-test-target/release/aien-test" "$RUNNER_TEMP/bin/aien-test"
181 echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"
182 cd "$GITHUB_WORKSPACE"
183 git status --porcelain --untracked-files=normal
184
185 - name: Fetch the signed Spark bundle for the tagged commit
186 run: |
187 url="$RECEIPTS_RAW/aien-protocols/${{ steps.ids.outputs.sha }}/bundle.json"
188 echo "bundle url: $url"
189 if ! curl -fsSL "$url" -o "$RUNNER_TEMP/bundle.json"; then
190 echo "::error::no signed Spark bundle for ${{ steps.ids.outputs.sha }} at $url"
191 exit 1
192 fi
193
194 - name: Verify the full bundle with the origin/main public key
195 run: |
196 required=$(grep -v '^#' "$RUNNER_TEMP/anchors/always" | grep -v '^$' | paste -sd, - || true)
197 set +e
198 aien-test verify-bundle "$RUNNER_TEMP/bundle.json" \
199 --repo "github.com/$REPO_SLUG" \
200 --commit "${{ steps.ids.outputs.sha }}" \
201 --pubkey "$RUNNER_TEMP/anchors/verify.pub" \
202 --require-full \
203 ${required:+--require "$required"}
204 rc=$?
205 set -e
206 echo "verify-bundle exit $rc (0 PASS, 1 FAIL, 2 NOT_RUN, 3 REJECTED)"
207 echo "::group::tag message"
208 git tag -l --format='%(contents)' "${GITHUB_REF#refs/tags/}"
209 echo "::endgroup::"
210 exit "$rc"