Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

ci(spec-owner): the gate decides approval only and no longer enables auto-merge (#8901)

Cindy Zhangcc51e5681f53
diff --git a/.github/DESIGNOWNERS b/.github/DESIGNOWNERS
index c14efed5df..5de4ef5871 100644
--- a/.github/DESIGNOWNERS
+++ b/.github/DESIGNOWNERS
@@ -8,14 +8,12 @@
# like every other owner; in a mixed PR every other applicable code or
# spec-owner group remains required. A classifier-proven appearance-only Core
# runtime change may bypass the engineering review gate only when no other
-# code reason applies. The
-# existing gate may enable squash auto-merge only when every changed path is a
-# recognized spec record and every required group and branch check passes.
+# code reason applies. The gate decides approval only; it never enables
+# auto-merge.
# - Review tooling may use the list to frame design-authored changes.
#
# This is not general merge permission. Design approval alone never
-# authorizes non-design records or mixed code/spec changes, and any code path
-# prevents the spec-only auto-merge path.
+# authorizes non-design records or mixed code/spec changes.
#
# Uses the same @handle format as CODEOWNERS. Keep this list current.
diff --git a/.github/REVIEW_GATE.md b/.github/REVIEW_GATE.md
index 001684193a..1b4d080c68 100644
--- a/.github/REVIEW_GATE.md
+++ b/.github/REVIEW_GATE.md
@@ -57,13 +57,9 @@ merge publishes nothing, and neither does a run yielding to a newer one.
GitHub has no conditional status write, so the window between the last read and
the write cannot be closed; the gate makes it one API call wide by reading the
live pull request last, and if a status still lands on a head that settled
-during that window, the run logs the status as unverified and stops before
-auto-merge.
+during that window, the run logs the status as unverified.
-The gate may enable squash auto-merge only when every changed path is a recognized spec record,
-every required owner group has approved the exact head, and all branch checks
-pass. Normative assets and indexes are outside that scope; adding any code path
-also prevents the spec-only auto-merge path.
+The gate decides approval only; it never enables auto-merge.
A PR changes only spec records when every changed path is one of:
@@ -80,9 +76,8 @@ Pure spec-record PRs do not add Changesets because they do not release packages;
CI rejects a PR containing only spec records and `.changeset` entries.
That classification fails closed on an empty or truncated file list and checks
both sides of a rename. Pure spec-record PRs run knowledge validation, skip
-runtime/build/visual work with successful required-status acknowledgements, and
-enable squash auto-merge after owner approval. Mixed code/spec changes keep full
-CI and never gain this auto-merge path.
+runtime/build/visual work with successful required-status acknowledgements.
+Mixed code/spec changes keep full CI.
## Sources of truth
@@ -188,8 +183,8 @@ An open PR whose head predates the gate has no `spec-owner-approval` status at
all. Requiring the context first would block those heads on a status no event
will produce, because the gate only runs on a new event. Backfill first.
-1. Land the gate changes, so the default branch has the `backfill` dispatch
- input. `workflow_dispatch` always runs the default branch's copy.
+1. Land the gate changes. `workflow_dispatch` always runs the default branch's
+ copy.
2. List the heads that would strand:
```sh
@@ -203,11 +198,10 @@ will produce, because the gate only runs on a new event. Backfill first.
done
```
-3. Backfill each one. `backfill=true` publishes the status and returns before
- auto-merge, so a reconcile cannot land a PR nobody asked to land:
+3. Backfill each one; a reconcile only publishes the status:
```sh
- gh workflow run spec-owner-gate.yml -f pr=<number> -f backfill=true
+ gh workflow run spec-owner-gate.yml -f pr=<number>
```
4. Re-run the step 2 query and confirm it prints nothing.
diff --git a/.github/scripts/spec-owner-reconcile.cjs b/.github/scripts/spec-owner-reconcile.cjs
index 99669d507d..e2e5b97acf 100644
--- a/.github/scripts/spec-owner-reconcile.cjs
+++ b/.github/scripts/spec-owner-reconcile.cjs
@@ -106,11 +106,6 @@ async function reconcileSpecOwnerGate({
}
const runId = BigInt(String(context.runId));
- // A boolean workflow_dispatch input arrives as a real boolean; a string
- // input arrives as text. Only an explicit true opts in.
- const backfillOnly =
- context.eventName === 'workflow_dispatch' &&
- String(context.payload.inputs?.backfill ?? 'false') === 'true';
const runUrl = canonicalRunUrl(
repository,
String(context.runId),
@@ -219,14 +214,6 @@ async function reconcileSpecOwnerGate({
return newest === null || newest.runId <= runId;
}
- async function currentPullForRun(headSha) {
- const current = await getPullRequest();
- if (current.head.sha !== headSha) return null;
- if (isSettled(current)) return null;
- if (!(await isCurrentRun(headSha))) return null;
- return current;
- }
-
async function setFinalStatus(headSha, state, description) {
if (!(await isPublishable(headSha))) return false;
await createStatus({
@@ -236,7 +223,7 @@ async function reconcileSpecOwnerGate({
description,
});
// The write cannot be undone, so verify what it landed on. A success that
- // raced a merge is reported loudly and stops this run before auto-merge.
+ // raced a merge is reported loudly.
const after = await getPullRequest();
if (isSettled(after) || after.head.sha !== headSha) {
core.warning(
@@ -287,23 +274,6 @@ async function reconcileSpecOwnerGate({
}
}
- async function disableAutoMerge(pr, {requireOwnership = true} = {}) {
- if (requireOwnership && !labelNames(pr).has(env.AUTO_MERGE_LABEL)) {
- return;
- }
- if (pr.auto_merge) {
- await github.graphql(
- `mutation($id: ID!) {
- disablePullRequestAutoMerge(input: {pullRequestId: $id}) {
- pullRequest { number }
- }
- }`,
- {id: pr.node_id},
- );
- }
- await removeLabel(env.AUTO_MERGE_LABEL);
- }
-
async function readText(fullName, ref, filePath) {
const [repoOwner, repoName] = fullName.split('/');
try {
@@ -428,22 +398,6 @@ async function reconcileSpecOwnerGate({
if (await restoreNewerStatus(initialHead)) return;
const commentAuthor = context.payload.comment?.user?.login?.toLowerCase();
- const reviewAuthor = context.payload.review?.user?.login?.toLowerCase();
- const explicitRevoke =
- context.eventName === 'issue_comment' &&
- commentAuthor &&
- allOwners.has(commentAuthor) &&
- parseOwnerCommand(context.payload.comment.body ?? '', initialHead) ===
- false;
- const currentReviewDismissal =
- context.eventName === 'pull_request_review' &&
- context.payload.action === 'dismissed' &&
- reviewAuthor &&
- allOwners.has(reviewAuthor) &&
- context.payload.review.commit_id === initialHead;
- if (explicitRevoke || currentReviewDismissal) {
- await disableAutoMerge(initialPr);
- }
const snapshot = await fetchSnapshot();
if (snapshot === null || snapshot.pr.head.sha !== initialHead) {
@@ -484,7 +438,6 @@ async function reconcileSpecOwnerGate({
}
if (!scope.touchesKnowledgeRecords) {
- await disableAutoMerge(pr);
await removeLabel(env.REVIEW_LABEL);
await setFinalStatus(
initialHead,
@@ -551,7 +504,6 @@ async function reconcileSpecOwnerGate({
.join(' and ');
if (ownerApprovalRequired && !approved) {
- await disableAutoMerge(pr);
if (!(await isCurrentRun(initialHead))) return;
await ensureLabel(
pr,
@@ -568,7 +520,6 @@ async function reconcileSpecOwnerGate({
}
if (pr.draft) {
- await disableAutoMerge(pr);
if (!(await isCurrentRun(initialHead))) return;
await removeLabel(env.REVIEW_LABEL);
await setFinalStatus(
@@ -585,81 +536,9 @@ async function reconcileSpecOwnerGate({
.join(' and ')} for ${initialHead.slice(0, 7)}.`
: 'Draft-only knowledge change; owner approval is not required.';
- if (!scope.specOnly) {
- await disableAutoMerge(pr);
- if (!(await isCurrentRun(initialHead))) return;
- await removeLabel(env.REVIEW_LABEL);
- await setFinalStatus(initialHead, 'success', successDescription);
- return;
- }
-
- // Owner approval is the gate decision; auto-merge is an optional convenience.
- // Publish the truthful terminal status first so an integration permission
- // failure cannot leave an approved head stuck on "Reconciling".
- if (!(await setFinalStatus(initialHead, 'success', successDescription))) {
- return;
- }
+ if (!(await isCurrentRun(initialHead))) return;
await removeLabel(env.REVIEW_LABEL);
-
- // A backfill exists to give an old head its missing status before the
- // context becomes required. Landing the pull request is a separate decision
- // its author has not asked this run to make.
- if (backfillOnly) {
- core.info('Backfill run: published the gate status without auto-merge.');
- return;
- }
-
- let enabledAutoMergeByThisRun = false;
- if (!pr.auto_merge) {
- const beforeEnable = await currentPullForRun(initialHead);
- if (beforeEnable === null || beforeEnable.auto_merge) return;
- await ensureLabel(
- beforeEnable,
- env.AUTO_MERGE_LABEL,
- 'bfdadc',
- 'Auto-merge was enabled by the spec owner gate',
- );
- const afterLabel = await currentPullForRun(initialHead);
- if (afterLabel === null || afterLabel.auto_merge) return;
- try {
- await github.graphql(
- `mutation($id: ID!, $oid: GitObjectID!) {
- enablePullRequestAutoMerge(input: {
- pullRequestId: $id,
- mergeMethod: SQUASH,
- expectedHeadOid: $oid
- }) {
- pullRequest { number }
- }
- }`,
- {id: pr.node_id, oid: initialHead},
- );
- enabledAutoMergeByThisRun = true;
- core.info(`Enabled squash auto-merge for spec-only PR #${pullNumber}.`);
- } catch (error) {
- // Leave the conservative ownership marker intact. The failure may be an
- // ambiguous response after a successful enable, or a newer run for the
- // same or a newer head may already be using the global marker. A stale
- // marker with auto-merge off is harmless: later reconciliation observes the real PR
- // state and can retry or remove it without racing a newer owner.
- core.warning(`Could not enable auto-merge: ${error.message}`);
- return;
- }
- }
-
- if (enabledAutoMergeByThisRun) {
- const afterEnable = await newestRun(initialHead);
- if (
- afterEnable !== null &&
- afterEnable.runId > runId &&
- afterEnable.status.state !== 'success'
- ) {
- await disableAutoMerge(await getPullRequest(), {
- requireOwnership: false,
- });
- return;
- }
- }
+ await setFinalStatus(initialHead, 'success', successDescription);
}
module.exports = {isCommandComment, reconcileSpecOwnerGate};
diff --git a/.github/scripts/spec-owner-reconcile.test.mjs b/.github/scripts/spec-owner-reconcile.test.mjs
index d399eeadca..b939a3fc7e 100644
--- a/.github/scripts/spec-owner-reconcile.test.mjs
+++ b/.github/scripts/spec-owner-reconcile.test.mjs
@@ -20,7 +20,6 @@ const repository = 'meta/astryx';
const workspace = path.resolve(import.meta.dirname, '../..');
const env = {
REVIEW_LABEL: 'needs:spec-owner-review',
- AUTO_MERGE_LABEL: 'spec-auto-merge',
};
function context({
@@ -304,7 +303,6 @@ describe('spec owner workflow reconciliation', () => {
state: 'success',
description: expect.stringContaining('Approved by @imdreamrunner'),
});
- expect(harness.state.calls).toContain('enable-auto-merge');
});
it('accepts every current ENGOWNER for a non-design spec', async () => {
@@ -388,7 +386,6 @@ describe('spec owner workflow reconciliation', () => {
state: 'success',
description: expect.stringContaining('Approved by @ernestt'),
});
- expect(harness.state.calls).toContain('enable-auto-merge');
});
it.each([
@@ -411,133 +408,6 @@ describe('spec owner workflow reconciliation', () => {
expect(harness.state.calls).not.toContain('enable-auto-merge');
});
- it('publishes owner approval and keeps conservative ownership when enablement is rejected', async () => {
- const harness = createApprovedHarness({
- onEnableAutoMerge: () => {
- const error = new Error('Resource not accessible by integration');
- error.status = 403;
- throw error;
- },
- });
-
- await run(harness, context({runId: 100n}));
-
- expect(latestGateStatus(harness.state)).toMatchObject({
- state: 'success',
- description: expect.stringContaining('Approved by @imdreamrunner'),
- });
- const terminalStatus = harness.state.calls.indexOf(
- 'status:spec-owner-approval:success',
- );
- const warning = harness.state.calls.findIndex(call =>
- call.includes('Could not enable auto-merge'),
- );
- expect(terminalStatus).toBeGreaterThan(-1);
- expect(warning).toBeGreaterThan(terminalStatus);
- expect(harness.state.calls).not.toContain('enable-auto-merge');
- expect(harness.state.labels.has('spec-auto-merge')).toBe(true);
- expect(harness.state.calls).not.toContain('remove-label:spec-auto-merge');
- expect(harness.state.calls).not.toContain('disable-auto-merge');
- expect(harness.state.pr.auto_merge).toBe(null);
- });
-
- it('preserves the marker when an ambiguous enable error follows a successful mutation', async () => {
- const harness = createApprovedHarness({
- onEnableAutoMerge: state => {
- state.pr.auto_merge = {merge_method: 'squash'};
- state.calls.push('auto-merge-applied-before-error');
- const error = new Error('The response was lost after the mutation.');
- error.status = 502;
- throw error;
- },
- });
-
- await run(harness, context({runId: 100n}));
-
- expect(latestGateStatus(harness.state).state).toBe('success');
- expect(harness.state.pr.auto_merge).toEqual({merge_method: 'squash'});
- expect(harness.state.labels.has('spec-auto-merge')).toBe(true);
- expect(harness.state.calls).not.toContain('remove-label:spec-auto-merge');
- expect(harness.state.calls).not.toContain('disable-auto-merge');
- });
-
- it('does not let an old failure erase newer same-head auto-merge ownership', async () => {
- const harness = createApprovedHarness({
- onEnableAutoMerge: state => {
- // The old run added the marker, then a newer run for the same exact
- // head enabled auto-merge before the old request returned an error.
- state.statuses.unshift(
- trustedStatus({runId: 101n, sha: head, state: 'success'}),
- );
- state.pr.auto_merge = {merge_method: 'squash'};
- state.labels.add('spec-auto-merge');
- state.pr.labels = [{name: 'spec-auto-merge'}];
- state.calls.push('newer-run-enabled-auto-merge');
- const error = new Error('The old enable request was rejected.');
- error.status = 422;
- throw error;
- },
- });
-
- await run(harness, context({runId: 100n}));
-
- expect(
- harness.state.statuses.some(
- status =>
- status.sha === head &&
- status.context === 'spec-owner-approval' &&
- status.state === 'success' &&
- status.target_url === canonicalRunUrl(repository, '100', '1'),
- ),
- ).toBe(true);
- expect(latestGateStatus(harness.state)).toMatchObject({
- state: 'success',
- target_url: canonicalRunUrl(repository, '101', '1'),
- });
- expect(harness.state.pr.head.sha).toBe(head);
- expect(harness.state.pr.auto_merge).toEqual({merge_method: 'squash'});
- expect(harness.state.labels.has('spec-auto-merge')).toBe(true);
- const oldMarker = harness.state.calls.indexOf('add-label:spec-auto-merge');
- const newerOwner = harness.state.calls.indexOf(
- 'newer-run-enabled-auto-merge',
- );
- expect(oldMarker).toBeGreaterThan(-1);
- expect(newerOwner).toBeGreaterThan(oldMarker);
- expect(harness.state.calls).not.toContain('remove-label:spec-auto-merge');
- expect(harness.state.calls).not.toContain('disable-auto-merge');
- });
-
- it('keeps terminal approval before a non-destructive enable failure path', () => {
- const source = fs.readFileSync(
- path.join(workspace, '.github/scripts/spec-owner-reconcile.cjs'),
- 'utf8',
- );
- const specOnlyPath = source.slice(
- source.indexOf('// Owner approval is the gate decision'),
- );
- const terminalStatus = specOnlyPath.indexOf(
- "setFinalStatus(initialHead, 'success', successDescription)",
- );
- const enable = specOnlyPath.indexOf('enablePullRequestAutoMerge');
- const catchStart = specOnlyPath.indexOf('} catch (error) {', enable);
- const catchEnd = specOnlyPath.indexOf(
- '\n }\n }\n\n if (enabledAutoMergeByThisRun)',
- catchStart,
- );
- const catchBlock = specOnlyPath.slice(catchStart, catchEnd);
-
- expect(terminalStatus).toBeGreaterThan(-1);
- expect(enable).toBeGreaterThan(terminalStatus);
- expect(catchStart).toBeGreaterThan(enable);
- expect(catchEnd).toBeGreaterThan(catchStart);
- expect(catchBlock).toContain(
- 'Leave the conservative ownership marker intact.',
- );
- expect(catchBlock).not.toContain('removeLabel');
- expect(catchBlock).not.toContain('disableAutoMerge');
- expect(catchBlock).not.toContain('cleanupFailedAutoMergeEnable');
- });
-
it('keeps a current theme change pending without exact-head approval', async () => {
const harness = createHarness({
changedFile: {
@@ -630,7 +500,6 @@ describe('spec owner workflow reconciliation', () => {
state: 'success',
description: expect.stringContaining('@rubyycheung'),
});
- expect(harness.state.calls).toContain('enable-auto-merge');
});
it('accepts an exact-head ENGOWNER review for a current theme record', async () => {
@@ -664,7 +533,6 @@ describe('spec owner workflow reconciliation', () => {
state: 'success',
description: expect.stringContaining('@czarandy'),
});
- expect(harness.state.calls).toContain('enable-auto-merge');
});
it('does not authorize a theme record through its self-declared owners', async () => {
@@ -717,65 +585,6 @@ describe('spec owner workflow reconciliation', () => {
).toHaveLength(1);
});
- it('disables gate-owned auto-merge before reconciling a later revoke', async () => {
- const harness = createApprovedHarness();
- await run(harness, context({runId: 100n}));
- harness.state.comments.push({
- user: {login: 'cixzhang'},
- body: `/revoke-spec ${head}`,
- created_at: '2026-08-30T10:01:00Z',
- });
-
- const beforeRevokeRun = harness.state.calls.length;
- await run(
- harness,
- context({
- runId: 101n,
- eventName: 'issue_comment',
- comment: harness.state.comments[0],
- }),
- );
-
- const secondPending = harness.state.calls.findIndex(
- (call, index) =>
- index >= beforeRevokeRun &&
- call === 'status:spec-owner-approval:pending',
- );
- const disabled = harness.state.calls.lastIndexOf('disable-auto-merge');
- expect(disabled).toBeGreaterThan(secondPending);
- expect(harness.state.pr.auto_merge).toBe(null);
- expect(latestGateStatus(harness.state).state).toBe('pending');
- });
-
- it('undoes its own enable when a revoke supersedes it after the ownership label is removed', async () => {
- const harness = createApprovedHarness({
- onEnableAutoMerge: state => {
- state.statuses.unshift(trustedStatus({runId: 101n}));
- state.labels.delete('spec-auto-merge');
- state.pr.labels = [];
- state.calls.push('interleaved-revoke');
- },
- });
-
- await run(harness, context({runId: 100n}));
-
- expect(harness.state.calls).toEqual(
- expect.arrayContaining([
- 'interleaved-revoke',
- 'enable-auto-merge',
- 'disable-auto-merge',
- ]),
- );
- expect(harness.state.calls.indexOf('interleaved-revoke')).toBeLessThan(
- harness.state.calls.indexOf('enable-auto-merge'),
- );
- expect(harness.state.calls.indexOf('enable-auto-merge')).toBeLessThan(
- harness.state.calls.indexOf('disable-auto-merge'),
- );
- expect(harness.state.labels.has('spec-auto-merge')).toBe(false);
- expect(harness.state.pr.auto_merge).toBe(null);
- });
-
it('yields to a newer run id instead of applying stale approval', async () => {
const harness = createHarness({
statuses: [trustedStatus({runId: 101n, state: 'success'})],
@@ -829,7 +638,7 @@ describe('spec owner workflow reconciliation', () => {
]);
});
- it('uses dismissal ordering and immediately disables owned auto-merge', async () => {
+ it('orders a dismissal after an earlier command by its timeline time', async () => {
const review = {
id: 17,
user: {login: 'cixzhang'},
@@ -855,8 +664,6 @@ describe('spec owner workflow reconciliation', () => {
dismissed_review: {review_id: 17},
},
],
- labels: ['spec-auto-merge'],
- autoMerge: {merge_method: 'squash'},
});
await run(
@@ -869,7 +676,6 @@ describe('spec owner workflow reconciliation', () => {
}),
);
- expect(harness.state.pr.auto_merge).toBe(null);
expect(latestGateStatus(harness.state).state).toBe('pending');
});
@@ -904,15 +710,6 @@ describe('spec owner workflow reconciliation', () => {
expect(harness.state.calls).not.toContain('enable-auto-merge');
});
- it('never auto-merges a draft PR', async () => {
- const harness = createApprovedHarness({draft: true});
-
- await run(harness, context({runId: 100n}));
-
- expect(harness.state.calls).not.toContain('enable-auto-merge');
- expect(harness.state.pr.auto_merge).toBe(null);
- });
-
it('reconciles same-repository owner reviews automatically', async () => {
const review = {
user: {login: 'cixzhang'},
@@ -934,7 +731,6 @@ describe('spec owner workflow reconciliation', () => {
expect(harness.state.pullGets).toBeGreaterThan(0);
expect(latestGateStatus(harness.state).state).toBe('success');
- expect(harness.state.calls).toContain('enable-auto-merge');
});
it('reconciles an exact-head owner command for a fork current-spec PR', async () => {
@@ -960,7 +756,6 @@ describe('spec owner workflow reconciliation', () => {
expect(harness.state.pullGets).toBeGreaterThan(0);
expect(latestGateStatus(harness.state).state).toBe('success');
- expect(harness.state.calls).toContain('enable-auto-merge');
});
it('rejects valid-shaped non-owner commands before API work', async () => {
@@ -1198,65 +993,6 @@ describe('spec owner workflow reconciliation', () => {
).toBe(true);
});
- describe('a backfill run publishes status without landing anything', () => {
- function backfillContext(runId) {
- return {
- actor: 'cixzhang',
- eventName: 'workflow_dispatch',
- runId,
- runAttempt: 1,
- repo: {owner: 'meta', repo: 'astryx'},
- payload: {inputs: {pr: '17', backfill: true}},
- };
- }
-
- it('publishes the missing status and never enables auto-merge', async () => {
- const harness = createApprovedHarness();
-
- await run(harness, backfillContext(100n));
-
- expect(latestGateStatus(harness.state)).toMatchObject({
- state: 'success',
- description: expect.stringContaining('Approved by @imdreamrunner'),
- });
- expect(harness.state.calls).not.toContain('enable-auto-merge');
- expect(harness.state.pr.auto_merge).toBe(null);
- expect(
- harness.state.calls.some(call => call.includes('Backfill run')),
- ).toBe(true);
- });
-
- it('still enables auto-merge on an ordinary dispatch', async () => {
- const harness = createApprovedHarness();
- const ordinary = backfillContext(100n);
- ordinary.payload.inputs.backfill = false;
-
- await run(harness, ordinary);
-
- expect(harness.state.calls).toContain('enable-auto-merge');
- });
-
- it('treats a string input the same way the form submits it', async () => {
- const harness = createApprovedHarness();
- const stringInput = backfillContext(100n);
- stringInput.payload.inputs.backfill = 'true';
-
- await run(harness, stringInput);
-
- expect(harness.state.calls).not.toContain('enable-auto-merge');
- });
-
- it('still refuses to publish onto an already merged head', async () => {
- const harness = createApprovedHarness();
- harness.state.pr.merged_at = '2026-08-30T09:00:00Z';
- harness.state.pr.state = 'closed';
-
- await run(harness, backfillContext(100n));
-
- expect(harness.state.statuses).toEqual([]);
- });
- });
-
describe('an owner command that misses the exact head is answered', () => {
function commandRun(body, harness = createHarness()) {
const comment = {
diff --git a/.github/scripts/spec-owner-workflow.test.mjs b/.github/scripts/spec-owner-workflow.test.mjs
index 1dea8e4aed..6163d0a4db 100644
--- a/.github/scripts/spec-owner-workflow.test.mjs
+++ b/.github/scripts/spec-owner-workflow.test.mjs
@@ -315,9 +315,8 @@ describe('spec-only workflow contract', () => {
expect(reconciler).toContain('designDecision.approved');
expect(reconciler).toContain('themeDecision.approved');
expect(reconciler).toContain('context: GATE_STATUS_CONTEXT');
- expect(reconciler).toContain('expectedHeadOid: $oid');
- expect(reconciler).toContain('mergeMethod: SQUASH');
- expect(reconciler).toContain('disablePullRequestAutoMerge');
+ // The gate decides approval only; merging stays with the merge path.
+ expect(reconciler).not.toContain('enablePullRequestAutoMerge');
});
it('derives the comment trigger from the parser\u2019s own prefixes', () => {
@@ -340,25 +339,6 @@ describe('spec-only workflow contract', () => {
}
});
- it('offers a backfill dispatch that publishes status without landing', () => {
- const workflow = read('.github/workflows/spec-owner-gate.yml');
- const reconciler = read('.github/scripts/spec-owner-reconcile.cjs');
-
- expect(workflow).toContain('backfill:');
- expect(workflow).toContain('type: boolean');
- expect(reconciler).toContain("context.eventName === 'workflow_dispatch'");
- expect(reconciler).toContain('backfillOnly');
- // The guard must sit after the terminal status and before enablement.
- const publish = reconciler.indexOf(
- "setFinalStatus(initialHead, 'success', successDescription)",
- );
- const guard = reconciler.indexOf('if (backfillOnly) {');
- const enable = reconciler.indexOf('enablePullRequestAutoMerge');
- expect(publish).toBeGreaterThan(-1);
- expect(guard).toBeGreaterThan(publish);
- expect(enable).toBeGreaterThan(guard);
- });
-
it('keeps the last read before a terminal write on the live pull request', () => {
const reconciler = read('.github/scripts/spec-owner-reconcile.cjs');
const guard = reconciler.slice(
diff --git a/.github/workflows/spec-owner-gate.yml b/.github/workflows/spec-owner-gate.yml
index a213da47c6..a4449f0297 100644
--- a/.github/workflows/spec-owner-gate.yml
+++ b/.github/workflows/spec-owner-gate.yml
@@ -6,24 +6,15 @@
# Design-decision-only changes, and normative design assets also accept
# DESIGNOWNERS. Mixed DD plus other component/module spec edits require both
# design and engineering. Other mixed PRs keep every applicable owner-group
-# requirement. Pure spec-record PRs
-# skip heavy CI only when every changed path is recognized; draft-only records
-# can auto-merge after validation, while current records also need approval on
-# the exact current head.
+# requirement. Pure spec-record PRs skip heavy CI only when every changed path
+# is recognized; current records need approval on the exact current head. The
+# gate decides approval only; it never enables auto-merge.
name: Spec owner gate
on:
pull_request_target:
branches: [main]
- types:
- [
- opened,
- synchronize,
- reopened,
- ready_for_review,
- converted_to_draft,
- auto_merge_enabled,
- ]
+ types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
pull_request_review:
types: [submitted, dismissed]
issue_comment:
@@ -34,20 +25,11 @@ on:
description: Pull request number to reconcile
required: true
type: string
- backfill:
- description: >-
- Publish the gate status only. Use this when backfilling heads that
- predate the required check, so a reconcile cannot also enable
- auto-merge on a pull request nobody asked to land.
- required: false
- default: false
- type: boolean
permissions: {}
env:
REVIEW_LABEL: needs:spec-owner-review
- AUTO_MERGE_LABEL: spec-auto-merge
jobs:
reconcile:
diff --git a/docs/architecture/knowledge-contracts.md b/docs/architecture/knowledge-contracts.md
index 454b692380..f0af637ecf 100644
--- a/docs/architecture/knowledge-contracts.md
+++ b/docs/architecture/knowledge-contracts.md
@@ -717,7 +717,7 @@ this flow passes the historical review benchmark and is enforced on pull request
current design and theme records, normative design assets, and DD-only current
component/module changes additionally accept `.github/DESIGNOWNERS`. A mixed
DD plus other component/module edit requires both groups. Record metadata never
- self-authorizes. The workflow enables auto-merge only for pure spec changes.
+ self-authorizes. The gate decides approval only; it never enables auto-merge.
- `.github/workflows/review-signal.yml` lets a DESIGNOWNER author bypass the
engineering gate only when trusted-base code verifies every changed Core line
against the fetched base/head source bytes as a conservative declaration inside
diff --git a/docs/design/README.md b/docs/design/README.md
index d86a1e7744..8dc3354b36 100644
--- a/docs/design/README.md
+++ b/docs/design/README.md
@@ -54,10 +54,7 @@ owners separately from this repository gate.
A DESIGNOWNER approves with an exact-head review or `/approve-spec <head>`,
like every other owner; in a mixed PR every other applicable code or spec-owner
-group remains required. The existing
-gate may enable squash auto-merge only when every changed path is a recognized
-spec record, every required group has approved, and all branch checks pass.
-Normative assets and indexes are outside that scope; any code path prevents the
-spec-only auto-merge path.
+group remains required. The gate decides approval only; it never enables
+auto-merge.
Use `docs/templates/knowledge/design-spec.md`.