Skip to content

Commit 2930be9

Browse files
committed
fix(check-affected): move the selector-owning sentinel to the Testing Matrix
The Testing Matrix moved from AGENTS.md to docs/agents/testing.md, but the affected-check selector still treated only AGENTS.md as selector-owning. A later matrix edit would have been classified as inert docs and skipped the fail-open, so the selector could keep deriving gates from a spec that had changed underneath it. Move the sentinel with the prose, as a named SELECTOR_OWNING_DOCS set so the next move is one line, and fix the two in-code comments plus the testing.md paragraph that still pointed at the AGENTS.md matrix.
1 parent 4eccf25 commit 2930be9

4 files changed

Lines changed: 24 additions & 8 deletions

File tree

‎docs/agents/testing.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,12 @@ sides of a rename are classified (a moved file cannot look docs-only by its
8686
destination alone).
8787

8888
Anything the selector cannot classify — unknown, ambiguous, workflow/tooling, or
89-
a change to the selector's own sources (including the `AGENTS.md` Testing
90-
Matrix) — **fails open to the full check set**.
89+
a change to the selector's own sources — **fails open to the full check set**.
90+
That includes this file: the Testing Matrix above is the prose the ownership
91+
rules mirror, so `docs/agents/testing.md` is selector-owning
92+
(`SELECTOR_OWNING_DOCS` in `scripts/check-affected/model.ts`) and outranks the
93+
docs-only short-circuit its path would otherwise take. If the matrix moves
94+
again, move that entry with it.
9195
The plan documents the rule and changed path behind every selected check.
9296

9397
Model and catalog live under `scripts/check-affected/`; the derivation is guarded

‎scripts/check-affected/checks.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ export const CHECK_CATALOG: readonly CheckSpec[] = [
145145
id: 'skillgym',
146146
label: 'SkillGym command-planning suite',
147147
kind: { type: 'script', script: 'test:skillgym' },
148-
// No GitHub workflow runs SkillGym; per the AGENTS.md testing matrix it is
149-
// a local-only gate (`pnpm test:skillgym`). Keep it locally runnable rather
150-
// than claiming a CI job that does not exist and silently skipping it.
148+
// No GitHub workflow runs SkillGym; per the Testing Matrix in
149+
// docs/agents/testing.md it is a local-only gate (`pnpm test:skillgym`).
150+
// Keep it locally runnable rather than claiming a CI job that does not
151+
// exist and silently skipping it.
151152
ciJobs: [],
152153
localRunnable: true,
153154
},

‎scripts/check-affected/model.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ test('workflow/tooling and selector-owning changes fail open', () => {
135135
plan(['scripts/check-affected/model.ts']).failOpenReasons[0]?.rule,
136136
'selector-owning',
137137
);
138-
assert.equal(plan(['AGENTS.md']).failOpenReasons[0]?.rule, 'selector-owning');
138+
// The Testing Matrix lives here; a matrix edit must outrank the docs-only
139+
// short-circuit that its `docs/` path would otherwise take.
140+
assert.equal(plan(['docs/agents/testing.md']).failOpenReasons[0]?.rule, 'selector-owning');
139141
});
140142

141143
test('a fail-open path in a mixed changeset forces the full set', () => {

‎scripts/check-affected/model.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,17 @@ const ROOT_TOOLING = new Set([
106106
'.npmrc',
107107
]);
108108

109+
// Prose that specifies this selector's own behavior — the Testing Matrix these
110+
// ownership rules mirror. It is docs by path, but editing it can invalidate the
111+
// derivation below, and the selector cannot tell whether it did. Keep this in
112+
// sync when the matrix moves; the docs short-circuit would otherwise treat it as
113+
// inert Markdown.
114+
const SELECTOR_OWNING_DOCS = new Set(['docs/agents/testing.md']);
115+
109116
function isSelectorOwning(file: string): boolean {
110117
return (
111-
file === 'AGENTS.md' || (file.startsWith('scripts/check-affected/') && !file.endsWith('.md'))
118+
SELECTOR_OWNING_DOCS.has(file) ||
119+
(file.startsWith('scripts/check-affected/') && !file.endsWith('.md'))
112120
);
113121
}
114122

@@ -221,7 +229,8 @@ const nodeIntegrationOwnership: OwnershipRule = ({ file }) =>
221229
: [];
222230

223231
// SkillGym validates skill guidance (`skills/`) and owns its harness
224-
// (`test/skillgym/`); AGENTS.md routes skill-prompt/assertion changes here.
232+
// (`test/skillgym/`); the Testing Matrix in docs/agents/testing.md routes
233+
// skill-prompt/assertion changes here.
225234
const skillgymOwnership: OwnershipRule = ({ file, underSkills }) =>
226235
underSkills || file.startsWith('test/skillgym/')
227236
? [

0 commit comments

Comments
 (0)