Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,14 @@ jobs:
# #2637 plan #8 (owner-approved): fail-fast tiering — the ~0-1m guards gate
# the four platform legs so a broken commit stops in tier 1 instead of
# paying 4x(install+typecheck+suites+build). Guards with `if: pull_request`
# skip on push/dispatch — and a SKIPPED need cascades the skip to dependents
# skip on push — and a SKIPPED need cascades the skip to dependents
# (the GitHub-documented behavior; the old comment here wrongly assumed
# "skipped needs count as satisfied" — the master-push run evidence
# (#3145/#3035/#3027 all slipped red to master with `test: skipped`)
# disproved it). The explicit `if` below tolerates skipped guards so:
# - pull_request: guards run; guard failure -> failure() -> legs skip
# (required checks show pending, merge blocked — #2637 semantics intact)
# - push/dispatch: PR-only guards skip harmlessly, legs RUN — master gets
# - push: PR-only guards skip harmlessly, legs RUN — master gets
# a real post-merge test signal (the missing master-push hole, #3197 era)
test:
needs: [plan, version-guard, kernel-guard, pi-subagents-guard, lane-guard, docs-sync, docs-coverage, unused-exports, lock-sync, test-import-graph]
Expand Down Expand Up @@ -385,15 +385,18 @@ jobs:

version-guard:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify version field only changes on release branches
run: |
set -euo pipefail
BRANCH="${GITHUB_HEAD_REF}"
# GITHUB_HEAD_REF is PR-only; on workflow_dispatch (release-ci-gate
# dispatches this workflow at release/bugfix branch refs) fall back to
# GITHUB_REF_NAME so the branch-pattern exemptions below keep matching.
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
# Release + bugfix carve-out branches (#2851/#2853) may bump version — one isolated 'release v{VERSION}' commit each.
# v3 gate-branch model (#4660): tag lanes keep their ONE legal pre-bump commit (made at cut time); the
# auto-opened alignment PR (head=bugfix) carries that bump into master, and backport carry branches
Expand All @@ -413,7 +416,7 @@ jobs:

kernel-guard:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -423,15 +426,23 @@ jobs:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
set -euo pipefail
BRANCH="${GITHUB_HEAD_REF}"
# GITHUB_HEAD_REF is PR-only; on workflow_dispatch fall back to
# GITHUB_REF_NAME (same rationale as version-guard above).
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
# Kernel release branches bump kernel/package.json alone by design.
if [[ "$BRANCH" == *_release-kernel-v* ]]; then
echo "✓ kernel release branch ($BRANCH) — kernel version changes allowed"
exit 0
fi
# Rule 1: any PR touching kernel/** must declare 'kernel-change:' in its body.
if git diff --name-only origin/master...HEAD -- kernel/ | grep -q .; then
if ! printf '%s' "$PR_BODY" | grep -q 'kernel-change:'; then
# Rule 1 enforcement is PR-shaped: the declaration lives in a PR
# body. A workflow_dispatch has no PR body — dispatch is
# owner-fired (release fallback / bugfix carve-out lanes), so the
# human gate has already happened out-of-band; skip only the
# body check there. Version-discipline rules below still run.
if [[ "${GITHUB_EVENT_NAME}" != "workflow_dispatch" ]] \
&& ! printf '%s' "$PR_BODY" | grep -q 'kernel-change:'; then
echo "::error::This PR modifies kernel/ but does not declare 'kernel-change: <reason>' in its body."
echo "Kernel changes are human-gated: owner approval plus explicit declaration required. See AGENTS.md 'Kernel Boundary'."
exit 1
Expand Down Expand Up @@ -466,7 +477,7 @@ jobs:
# load-bearing core compression).
pi-subagents-guard:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -556,7 +567,7 @@ jobs:
# mechanical: lane logic moves ⇔ a side-lane suite moves with it.
lane-guard:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions kernel/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading