From a54948c574aac4ae559366b8e89cb3f4f147c4fd Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Sun, 1 Nov 2026 05:34:41 +0000 Subject: [PATCH] Preserve copied-evidence boundaries when reading feedback fields Keep the original Markdown declaration flags while extracting the complete selection. Copied code, quotations and raw HTML neither supply nor veto feedback metadata; retain the complete-field and mutable-consumer checks alongside that existing safety rule. Contract-Neutral: Preserve existing silent metadata authority and copied-evidence boundaries; no product subsystem, dependency, wire or rendered application change. Change-source: pulse-maintainer --- .github/scripts/issue-version-triage.cjs | 9 +++++--- .github/scripts/issue-version-triage.test.cjs | 22 +++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/scripts/issue-version-triage.cjs b/.github/scripts/issue-version-triage.cjs index 95a860cb60..12900f1d56 100644 --- a/.github/scripts/issue-version-triage.cjs +++ b/.github/scripts/issue-version-triage.cjs @@ -185,7 +185,7 @@ function firstFieldValue(lines, start = 0) { return ""; } -function extractSectionValues(body, heading, followingHeadings = [], report = parseReportMarkdown(body)) { +function extractSectionValues(body, heading, followingHeadings = [], report = parseReportMarkdown(body), declarationsOnly = false) { if (!body) return []; const lines = report.lines; const pattern = new RegExp(`^${escapeRegExp(heading)}$`, "i"); @@ -200,7 +200,8 @@ function extractSectionValues(body, heading, followingHeadings = [], report = pa boundary.test(lines[end].heading))))) { end += 1; } - values.push(lines.slice(start + 1, end).map((line) => line.text).join("\n").trim()); + values.push(lines.slice(start + 1, end).map((line) => + !declarationsOnly || line.declaration ? line.text : "").join("\n").trim()); // A deeper, form-named subheading is part of this value, not another // declaration. Only resume at the boundary that ended the field. start = end - 1; @@ -433,7 +434,9 @@ function classifyFeedbackSelection(feedbackType, report) { } function classifyV6FeedbackType(body, report = parseReportMarkdown(body)) { - const classes = extractSectionValues(body, "Feedback type", [], report) + // Preserve the report's original block context. Re-lexing copied code or a + // quote as bare field text could let examples supply or veto a selection. + const classes = extractSectionValues(body, "Feedback type", [], report, true) .map(value => classifyFeedbackSelection(value, report)); // Repeated declarations must agree on the metadata category. Choosing the // first can invent a bug and its version requirements from contradictory or diff --git a/.github/scripts/issue-version-triage.test.cjs b/.github/scripts/issue-version-triage.test.cjs index 3563df5b06..13e7898008 100644 --- a/.github/scripts/issue-version-triage.test.cjs +++ b/.github/scripts/issue-version-triage.test.cjs @@ -498,8 +498,6 @@ test("feedback classification examines the complete field instead of its first l "Documentation issue\nBug / regression", "Bug / regression\nThis is a question, not a selected form option.", "Documentation issue\n\nBug / regression", - "Bug / regression\n\n> Documentation issue", - "Bug / regression\n\n```text\nDocumentation issue\n```", "Bug / regression\n\n", "Bug / regression\n\n- Documentation issue", ]) { @@ -526,6 +524,26 @@ test("a complete single choice retains wrapping, hidden comments and shared refe } }); +test("copied blocks cannot supply or contradict a feedback selection", () => { + for (const copied of [ + "> Documentation issue", + "```text\nDocumentation issue\n```", + " Documentation issue", + "