Skip to content

Commit b8af88b

Browse files
committed
test(ui-merge): the ui register's workflows row is read through the root register (pending a ruling)
objectui's queue-guard register declares `.github/workflows/**` by the maintainer's ruling on objectui#12255, and `every declared surface exists in this tree` reads each row's directory under `ui/`. That directory is gone with the nested workflows. The guard that runs is the root one, and its register governs `ui/.github/workflows/**` at Tier H. So for that row, the existence case gives way to a case that asks the root predicate, by path, and that goes red again if the directory comes back. This is one of three options for a maintainer decision on objectstack#25712: drop the row, keep it as here, or retire this register for the root one in sub-issue 4. It is a separate commit so the ruling can replace it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A6SEitNngAMugGbuJHWsDS
1 parent 02ed94e commit b8af88b

1 file changed

Lines changed: 32 additions & 3 deletions

File tree

‎ui/scripts/__tests__/check-governed-queue-guard.test.ts‎

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from 'vitest';
2-
import { execFileSync } from 'node:child_process';
2+
import { execFileSync, spawnSync } from 'node:child_process';
33
import fs from 'node:fs';
44
import path from 'node:path';
55
import { fileURLToPath } from 'node:url';
@@ -13,6 +13,7 @@ import {
1313
} from '../check-governed-queue-guard.mjs';
1414

1515
import { selfTestCases, stripAnsi } from './helpers/child-verdict';
16+
import { workspaceRoot } from '../workspace-root.mjs';
1617

1718
const ROOT = path.resolve(fileURLToPath(import.meta.url), '../../..');
1819
const GATE = 'scripts/check-governed-queue-guard.mjs';
@@ -107,8 +108,17 @@ describe('the governed surface is the ruled definition, and it is real', () => {
107108
]);
108109
});
109110

110-
it('every declared surface exists in this tree', () => {
111-
for (const surface of GOVERNED_SURFACES) {
111+
/**
112+
* The one row whose directory left this tree: objectstack#25712 deleted
113+
* `ui/.github/workflows/`, which GitHub never ran under the monorepo. ⚠️ PENDING
114+
* the maintainer's call on objectstack#25712, since the row is objectui#12255's
115+
* ruling: drop it, keep it as below, or retire this register for the root one
116+
* (sub-issue 4).
117+
*/
118+
const MOVED = 'workflows';
119+
120+
it('every declared surface exists in this tree, the moved workflows row aside', () => {
121+
for (const surface of GOVERNED_SURFACES.filter((s) => s.id !== MOVED)) {
112122
// `in` rather than `surface.prefix ?? surface.exact`: the register is a
113123
// union of frozen literals, so exactly one of the two keys exists on each
114124
// member and neither exists on all of them. `tsconfig.scripts.json` infers
@@ -124,6 +134,25 @@ describe('the governed surface is the ruled definition, and it is real', () => {
124134
}
125135
});
126136

137+
it('the workflows row moved: the root register governs ui/.github/workflows/** at Tier H', () => {
138+
// Self-retiring: once the directory is back, the case above must read it again.
139+
expect(
140+
fs.existsSync(path.join(ROOT, '.github/workflows')),
141+
'ui/.github/workflows/ exists again: fold the workflows row back into the existence case above',
142+
).toBe(false);
143+
// The guard that runs is the root one, so its own predicate is asked, by path.
144+
const probe = 'ui/.github/workflows/ci.yml';
145+
const run = spawnSync('node', ['scripts/pm/check-governed-merges.mjs', '--test', probe, '--json'], {
146+
cwd: workspaceRoot(),
147+
encoding: 'utf8',
148+
});
149+
expect(run.stdout, run.stderr).toMatch(/^\{/);
150+
const verdict = JSON.parse(run.stdout) as { governed: boolean; tier: string; matched: Array<{ id: string; files: string[] }> };
151+
expect(verdict.governed).toBe(true);
152+
expect(verdict.tier).toBe('H');
153+
expect(verdict.matched.map((s) => [s.id, s.files])).toEqual([['ui-workflows', [probe]]]);
154+
});
155+
127156
it('governs every workflow, its own included, and not the script that workflow runs', () => {
128157
// This case used to pin the opposite ("does not govern its own workflow, or
129158
// CI configuration generally") as the widening deliberately NOT taken. The

0 commit comments

Comments
 (0)