Skip to content

Commit ec59881

Browse files
committed
fix(ci): tighten issue-quality soft-pass structure gate
Require at least two rich markdown sections before soft-pass, and treat provider metadata headings as mapped so partial English forms cannot bypass Current/Expected behaviour.
1 parent 8cd659c commit ec59881

2 files changed

Lines changed: 45 additions & 5 deletions

File tree

.github/scripts/issue-quality.cjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ function resolveSection(body, headings) {
150150
}
151151

152152
/**
153-
* True when the body has at least one non-empty h2–h4 section with enough
154-
* detail. Used for soft-pass only — unstructured length alone is not enough.
153+
* True when the body has multiple non-empty h2–h4 sections with enough detail.
154+
* Soft-pass only — unstructured length alone is not enough, and a single
155+
* arbitrary heading must not bypass the quality gate (Codex on #564).
155156
*/
156-
function hasSubstantialStructuredContent(body, minSectionLen = 40) {
157+
function hasSubstantialStructuredContent(body, minSectionLen = 40, minRichSections = 2) {
157158
if (typeof body !== "string") return false;
158159
const lines = body.split("\n");
159160
let capturing = false;
@@ -173,7 +174,7 @@ function hasSubstantialStructuredContent(body, minSectionLen = 40) {
173174
if (capturing) bucket.push(line);
174175
}
175176
if (capturing) flush();
176-
return richSections >= 1;
177+
return richSections >= minRichSections;
177178
}
178179

179180
// ---------------------------------------------------------------------------
@@ -695,7 +696,8 @@ function validateIssue(issue) {
695696
// Same soft-pass as bug/feature: label- or maintainer-scoped provider
696697
// reports often use non-English structured headings after a retitle.
697698
const mappedHeadingPresent =
698-
current !== null || expected !== null || repro !== null || response !== null || docs !== null;
699+
current !== null || expected !== null || repro !== null || response !== null || docs !== null ||
700+
provider !== null || version !== null || endpoint !== null;
699701
const canSoftPass =
700702
!mappedHeadingPresent &&
701703
hasSubstantialStructuredContent(body);

.github/scripts/issue-quality.test.cjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,44 @@ describe("translated feature headings and soft-pass", () => {
10491049
assert.equal(result.valid, false);
10501050
});
10511051

1052+
it("does not soft-pass a single arbitrary rich heading (Codex #564)", () => {
1053+
const result = validateIssue({
1054+
title: "Something broke after upgrade",
1055+
body: [
1056+
"## Notes",
1057+
"x".repeat(80),
1058+
].join("\n"),
1059+
labels: ["bug"],
1060+
storedKind: "bug",
1061+
});
1062+
assert.equal(result.kind, "bug");
1063+
assert.equal(result.softPass, false);
1064+
assert.equal(result.valid, false);
1065+
assert.match(result.reasons.join(" "), /Summary and Reproduction are empty/);
1066+
});
1067+
1068+
it("does not soft-pass provider reports that only fill mapped metadata headings", () => {
1069+
const result = validateIssue({
1070+
title: "Provider X fails on Responses",
1071+
body: [
1072+
"### Provider or upstream service",
1073+
"custom-openai-compatible gateway hosted on our internal mesh",
1074+
"### OpenCodex version",
1075+
"2.7.41",
1076+
"### Endpoint or capability",
1077+
"`POST /v1/responses` with streaming tool calls",
1078+
"## Extra notes",
1079+
"We see intermittent 502s after rotating the upstream API key for this gateway.",
1080+
].join("\n"),
1081+
labels: ["provider-compatibility"],
1082+
storedKind: "provider-compatibility",
1083+
});
1084+
assert.equal(result.kind, "provider-compatibility");
1085+
assert.equal(result.softPass, false);
1086+
assert.equal(result.valid, false);
1087+
assert.match(result.reasons.join(" "), /current behaviour|expected behaviour/i);
1088+
});
1089+
10521090
it("still rejects empty [Feature]: bodies", () => {
10531091
const result = validateIssue({
10541092
title: "[Feature]: do something cool",

0 commit comments

Comments
 (0)