Skip to content

Commit c8122a1

Browse files
committed
fix(review): narrow stable maturity issue labels
1 parent 36179dc commit c8122a1

8 files changed

Lines changed: 93 additions & 34 deletions

‎prompts/review-item.md‎

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,35 @@ Prefer `impact:ux-release-blocker` over `impact:ux-friction` when the same
254254
evidence supports both.
255255

256256
Set `maturityLabels` for issues only; use `[]` for PRs or unsupported matches.
257-
`maturity:stable`: The issue's primary taxonomy surface is currently scored M4/M5.
257+
`maturity:stable`: The issue reports broken existing behavior whose primary
258+
taxonomy owner is currently scored M4/M5. M4/M5 ownership is necessary but is
259+
not enough by itself: this label is not a general description of the feature
260+
area's maturity.
258261
First run `node "$CLAWSWEEPER_PROOF_SCRATCH_DIR/maturity-stable-shortlist.mjs"`
259262
from the target checkout. Identify exactly one primary owner surface from the
260-
broken or missing product behavior and the source owner boundary. Shared
263+
broken product behavior and the source owner boundary. Shared
261264
Gateway/CLI transit, APIs, hosting, diagnostics, or implementation plumbing do
262-
not qualify an issue whose primary owner is below M4. A feature proposal does
263-
not qualify merely because implementing it would modify a stable surface.
264-
The helper lists both eligible M4+ surfaces and below-M4 exclusions. Read
265+
not qualify an issue whose primary owner is below M4.
266+
267+
Before selecting the label, first decide whether current docs, tests, an API or
268+
CLI contract, or established shipped behavior define the expected behavior the
269+
issue says is broken. Prefer `[]` unless that existing contract and the M4/M5
270+
primary owner are both supported by current-source evidence. Use `[]` for a
271+
feature proposal, new capability, UX preference, new configuration or policy
272+
choice, docs/support request, cleanup, or unclear report even when it concerns
273+
an M4/M5 surface. `itemCategory: feature`, `skill`, `support`, `admin`,
274+
`docs`, `cleanup`, or `unclear`, or `requiresNewFeature: true` or
275+
`requiresNewConfigOption: true`, is a strong reason to use `[]`; do not
276+
relabel the request as a bug merely to make it eligible. If the
277+
existing-behavior contract or primary owner remains ambiguous after reading
278+
the relevant source, use `[]`.
279+
280+
The helper lists M4+ candidate owner surfaces and below-M4 exclusions. Read
265281
`taxonomy.yaml`, the full checked-out `qa/maturity-scores.yaml`, or
266282
`docs/maturity/` when the primary owner or category is ambiguous. Select
267-
`maturity:stable` only when that primary surface is M4/M5. Cite the primary
268-
surface id/name/code and the matching category in `evidence` and
269-
`labelJustifications`.
283+
`maturity:stable` only when the broken existing contract's primary surface is
284+
M4/M5. Cite both the contract evidence and the primary surface id/name/code
285+
with its matching category in `evidence` and `labelJustifications`.
270286
Stable maturity supports priority, but does not automatically escalate it.
271287

272288
Set `mergeRiskLabels` as PR-only ClawSweeper-owned GitHub labels for merge

‎schema/clawsweeper-decision.schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"type": "string",
314314
"enum": ["maturity:stable"]
315315
},
316-
"description": "Issue-only labels for mature taxonomy matches. Use [] for PRs. Select maturity:stable only when the issue's primary owner surface is currently M4/M5 in qa/maturity-scores.yaml; incidental Gateway/CLI transit or implementation plumbing does not qualify a lower-maturity surface."
316+
"description": "Issue-only labels for broken existing behavior on a mature taxonomy surface. Use [] for PRs. M4/M5 primary ownership in qa/maturity-scores.yaml is necessary but not sufficient: select maturity:stable only when current docs, tests, API/CLI contracts, or established shipped behavior define the expected behavior that is broken. Use [] for feature proposals, new capabilities, UX preferences, new config or policy choices, docs/support work, cleanup, and unclear reports even when they concern an M4/M5 surface. Incidental Gateway/CLI transit or implementation plumbing does not qualify a lower-maturity surface. When the existing-behavior contract or primary owner remains ambiguous, use []."
317317
},
318318
"mergeRiskOptions": {
319319
"type": "array",

‎scripts/maturity-stable-shortlist.mjs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ function stableShortlist(text) {
1919
const nonStableRows = rows.filter((surface) => maturityCode(surface) < 4);
2020

2121
return [
22-
"Primary-surface rule: classify the issue by the product surface that owns the broken or missing behavior. Shared Gateway/CLI transit, APIs, hosting, or diagnostics do not make a lower-maturity owner eligible.",
22+
"Conservative rule: maturity:stable is for broken existing behavior, not feature proposals, new capabilities, UX preferences, new config or policy choices, docs/support work, cleanup, or unclear reports. M4+ ownership is necessary but not sufficient; use no maturity label when the existing contract or primary owner is ambiguous.",
23+
"Primary-surface rule: classify the issue by the product surface that owns the broken behavior. Shared Gateway/CLI transit, APIs, hosting, or diagnostics do not make a lower-maturity owner eligible.",
2324
"",
24-
"M4+ primary surfaces (eligible for maturity:stable):",
25+
"M4+ candidate primary owners (the issue must still report broken existing behavior):",
2526
...(stableRows.length > 0
2627
? stableRows.map((surface) => {
2728
const categories = surface.categories.length

‎src/clawsweeper-label-mutations.ts‎

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -184,25 +184,21 @@ export function createLabelMutationOperations(
184184
function ensureMaturityLabel(name: MaturityLabelName, onMutation?: () => void): void {
185185
const definition = MATURITY_LABELS.find((label) => label.name === name);
186186
if (!definition) return;
187-
try {
188-
ghObservedMutationCommand({
189-
identity: `label_create:${definition.name}`,
190-
args: [
191-
"label",
192-
"create",
193-
definition.name,
194-
"--color",
195-
definition.color,
196-
"--description",
197-
definition.description,
198-
],
199-
attempts: 2,
200-
onMutation,
201-
knownNoMutation: labelAlreadyExistsError,
202-
});
203-
} catch (error) {
204-
if (!labelAlreadyExistsError(error)) throw error;
205-
}
187+
ghObservedMutationCommand({
188+
identity: `label_upsert:${definition.name}`,
189+
args: [
190+
"label",
191+
"create",
192+
definition.name,
193+
"--force",
194+
"--color",
195+
definition.color,
196+
"--description",
197+
definition.description,
198+
],
199+
attempts: 2,
200+
onMutation,
201+
});
206202
}
207203
function ensurePrRatingLabel(tier: PrRatingTier, onMutation?: () => void): void {
208204
const definition = ratingLabelForTier(tier);

‎src/clawsweeper-policy.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ export const MATURITY_LABELS = [
376376
{
377377
name: "maturity:stable",
378378
color: "1F883D",
379-
description: "Issue's primary taxonomy surface is currently scored M4/M5.",
379+
description: "Broken existing behavior primarily owned by an M4/M5 scorecard surface.",
380380
},
381381
] as const satisfies readonly {
382382
name: MaturityLabelName;

‎test/maturity-shortlist-script.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ test("maturity shortlist script distinguishes eligible primary surfaces from exc
3838
scorecard,
3939
]).toString();
4040

41+
assert.match(output, /Conservative rule: maturity:stable is for broken existing behavior/);
42+
assert.match(output, /M4\+ ownership is necessary but not sufficient/);
4143
assert.match(output, /Primary-surface rule:/);
42-
assert.match(output, /M4\+ primary surfaces \(eligible for maturity:stable\):/);
44+
assert.match(output, /M4\+ candidate primary owners/);
4345
assert.match(output, /gateway-runtime \| Gateway runtime \| M4 Stable \| q81 c89/);
4446
assert.match(output, /categories: HTTP APIs/);
4547
assert.match(output, /Below-M4 primary surfaces \(not eligible for maturity:stable\):/);

‎test/pr-label-policy.test.ts‎

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import assert from "node:assert/strict";
22
import test from "node:test";
33

4+
import { createLabelSynchronization } from "../dist/clawsweeper-label-sync.js";
45
import {
56
featureShowcaseLabelsForTest,
67
goodFirstIssueLabelOptedOutForTest,
@@ -733,7 +734,7 @@ test("ClawSweeper maturity labels remove stale owned labels and preserve unrelat
733734
{
734735
name: "maturity:stable",
735736
color: "1F883D",
736-
description: "Issue's primary taxonomy surface is currently scored M4/M5.",
737+
description: "Broken existing behavior primarily owned by an M4/M5 scorecard surface.",
737738
},
738739
]);
739740
assert.deepEqual(maturityLabelsForTest(["bug"], ["maturity:stable"]), ["bug", "maturity:stable"]);
@@ -743,6 +744,45 @@ test("ClawSweeper maturity labels remove stale owned labels and preserve unrelat
743744
]);
744745
});
745746

747+
test("ClawSweeper updates managed maturity label metadata before applying it", () => {
748+
const commands: string[][] = [];
749+
const labels = createLabelSynchronization({
750+
ghObservedMutationCommand: ({ args }: { args: string[] }) => {
751+
commands.push(args);
752+
return "";
753+
},
754+
hasNormalizedLabel: (current: readonly string[], label: string) =>
755+
current.some((candidate) => candidate.toLowerCase() === label.toLowerCase()),
756+
normalizeLabelName: (label: string) => label.toLowerCase(),
757+
protectedLabels: () => [],
758+
isBulkFilerExemptAuthorAssociation: () => false,
759+
isBulkFilerExemptRepositoryPermission: () => false,
760+
frontMatterValue: () => undefined,
761+
frontMatterStringArray: () => [],
762+
reportSecurityReview: () => ({ status: "not_applicable", evidence: [] }),
763+
reviewSectionValue: () => "",
764+
labelPolicy: {},
765+
} as never);
766+
767+
labels.syncMaturityLabels({
768+
number: 42,
769+
labels: ["bug"],
770+
maturityLabels: ["maturity:stable"],
771+
dryRun: false,
772+
});
773+
774+
assert.deepEqual(commands[0], [
775+
"label",
776+
"create",
777+
"maturity:stable",
778+
"--force",
779+
"--color",
780+
"1F883D",
781+
"--description",
782+
"Broken existing behavior primarily owned by an M4/M5 scorecard surface.",
783+
]);
784+
});
785+
746786
test("ClawSweeper impact labels do not alter PR review finding priorities", () => {
747787
const decision = parseDecision(
748788
closeDecision({

‎test/review-prompt-policy.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,11 @@ test("review prompt uses token-light maturity shortlist helper", () => {
513513
assert.match(prompt, /maturity-stable-shortlist\.mjs/);
514514
assert.match(prompt, /Identify exactly one primary owner surface/);
515515
assert.match(prompt, /Shared\s+Gateway\/CLI transit/);
516-
assert.match(prompt, /feature proposal does\s+not qualify/);
516+
assert.match(prompt, /M4\/M5 ownership is necessary but is\s+not enough by itself/);
517+
assert.match(prompt, /current docs, tests, an API or\s+CLI contract/);
518+
assert.match(prompt, /feature proposal, new capability, UX preference/);
519+
assert.match(prompt, /requiresNewFeature: true/);
520+
assert.match(prompt, /existing-behavior\s+contract or primary owner remains ambiguous/);
517521
assert.match(
518522
runtimePrompt,
519523
/node "\$CLAWSWEEPER_PROOF_SCRATCH_DIR\/maturity-stable-shortlist\.mjs"/,

0 commit comments

Comments
 (0)