Commit d3da963
ci: restrict abi-drift + zig-test cartridge loops to PR-changed cartridges (#147)
## Summary
Both `abi-drift` (verify) and `zig-test` (Zig FFI Tests) currently sweep
every cartridge under `cartridges/*` and fail the PR check if any one of
them fails. With ~66 cartridges in the abi-drift allowlist and ~73 in
zig-test, a PR touching a single cartridge gets gated by unrelated
breakage in others — e.g. browser-mcp and orchestrator-lsp-mcp Zig
failures, container-mcp/git-mcp/queues-mcp/vordr-mcp ABI drift — that
has been sitting on `main` for weeks.
This PR constrains both per-cartridge loops on **pull_request events**
to the intersection of:
1. the existing allowlist / discovery, and
2. cartridges with any file changed under `cartridges/<name>/**` in this
PR's diff against `origin/<base_ref>`.
**On `push: main` the full sweep is preserved**, so cross-cutting drift
is still caught at trunk. This is purely a PR-time false-positive fix,
not a relaxation of the gate.
## Why now
Surfaced by the investigation in PR #146: that PR touches only
`local-coord-mcp`, but was blocked by failures in 6+ cartridges it
didn't change. The other gating workflows that scan all cartridges have
the same pathology; this PR fixes the two that have clean per-cartridge
loops.
## Changes
- `.github/workflows/abi-drift.yml` — new "Restrict to cartridges
changed in this PR" step; the verify loop reads the filtered set on PR,
full allowlist on push. `fetch-depth: 0` added so the diff can resolve.
- `.github/workflows/zig-test.yml` — new "Determine cartridges to test"
step; both the FFI tests loop and the shared-library build loop read the
in-scope set. Catalogue/readiness steps still run on every invocation —
they test cross-cartridge plumbing.
Empty changed-set on a PR (which the `paths:` filter shouldn't allow,
but defensive) emits a `::notice::` and exits 0 instead of going red on
nothing.
## Out of scope
- `tests/aspect_tests.sh` (the "Aspect — Thread Safety + ABI Contract +
SPDX" check) asserts **global** invariants across the whole tree, so a
"changed-files" filter doesn't fit it cleanly. Best handled with a
baseline-aware ratchet — separate PR.
## Test plan
- [x] `python3 -c "import yaml; yaml.safe_load(...)"` both YAML files
(clean)
- [ ] This PR itself triggers `zig-test` (touches
`.github/workflows/zig-test.yml` but no `cartridges/**`) — expect the
"Determine cartridges to test" step to print an empty scope and the
per-cartridge steps to no-op via the `::notice::` path
- [ ] PR #146 (touches `cartridges/local-coord-mcp/**`) should, when
rebased onto this once merged, run abi-drift and zig-test against only
`local-coord-mcp` and skip the unrelated failing cartridges
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
_Generated by [Claude
Code](https://claude.ai/code/session_018MBrAtPrwfgn2WG4BAerZW)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2dff04d commit d3da963
2 files changed
Lines changed: 115 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
165 | 170 | | |
166 | 171 | | |
167 | 172 | | |
168 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
169 | 188 | | |
| 189 | + | |
| 190 | + | |
170 | 191 | | |
171 | 192 | | |
172 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
173 | 226 | | |
174 | 227 | | |
175 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
33 | 43 | | |
34 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
35 | 76 | | |
36 | 77 | | |
37 | 78 | | |
38 | 79 | | |
39 | 80 | | |
40 | 81 | | |
41 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
42 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
43 | 90 | | |
44 | | - | |
| 91 | + | |
| 92 | + | |
45 | 93 | | |
46 | 94 | | |
47 | 95 | | |
| |||
51 | 99 | | |
52 | 100 | | |
53 | 101 | | |
54 | | - | |
| 102 | + | |
55 | 103 | | |
56 | 104 | | |
57 | 105 | | |
58 | 106 | | |
59 | 107 | | |
60 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
61 | 111 | | |
62 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
63 | 118 | | |
64 | 119 | | |
65 | 120 | | |
66 | | - | |
| 121 | + | |
67 | 122 | | |
68 | 123 | | |
69 | 124 | | |
| |||
0 commit comments