Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/scripts/verifier_issue_formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,16 @@ function extractUncheckedItems(content) {
// Match unchecked boxes: - [ ] or * [ ]
const match = line.match(/^\s*[-*]\s+\[\s\]\s+(.+)$/);
if (match) {
items.push(match[1].trim());
const text = match[1].trim();
// Skip markdown section headers that were incorrectly captured as criteria
if (text.startsWith('#') || text.startsWith('##')) {
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for startsWith('##') is redundant since any string starting with '##' will also start with '#'. The first condition will always catch both cases. Consider removing the || text.startsWith('##') portion to simplify the logic without changing behavior.

Suggested change
if (text.startsWith('#') || text.startsWith('##')) {
if (text.startsWith('#')) {

Copilot uses AI. Check for mistakes.
continue;
}
// Skip items that look like markdown links to sections (e.g., "- PR #123")
if (/^[-–]\s*(PR|Issue)\s*#\d+/i.test(text)) {
Comment on lines +191 to +192
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern is checking for text that starts with a hyphen/dash followed by "PR" or "Issue", but at this point text has already been extracted from the checkbox content (via match[1].trim()). The leading - or * was consumed by the checkbox pattern on line 184, so text will never start with - or .

For example, if the input line is - [ ] - PR #296 - Description, then match[1] captures - PR #296 - Description, which will correctly match this pattern. However, if the input is - [ ] PR #296 - Description (without a leading dash after the checkbox), it won't match.

Consider simplifying the pattern to /^(PR|Issue)\s*#\d+/i to match text that starts directly with "PR" or "Issue" followed by a number. Alternatively, if you want to handle both cases, use /^[-–]?\s*(PR|Issue)\s*#\d+/i to make the leading dash optional.

Suggested change
// Skip items that look like markdown links to sections (e.g., "- PR #123")
if (/^[-]\s*(PR|Issue)\s*#\d+/i.test(text)) {
// Skip items that look like markdown links to sections (e.g., "- PR #123" or "PR #123")
if (/^[-]?\s*(PR|Issue)\s*#\d+/i.test(text)) {

Copilot uses AI. Check for mistakes.
continue;
}
items.push(text);
}
}

Expand Down Expand Up @@ -352,11 +361,11 @@ function formatFollowUpIssue({
if (findings.gaps.length > 0) {
newTasks = findings.gaps.map((gap) => `Address: ${gap}`);
} else if (findings.unmetCriteria.length > 0) {
// Use verifier's specific unmet criteria
newTasks = findings.unmetCriteria.map((criterion) => `Satisfy: ${criterion}`);
// Use verifier's specific unmet criteria (no prefix - it's clear these need work)
newTasks = findings.unmetCriteria;
} else {
// Fall back to creating tasks from unmet acceptance criteria
newTasks = refinedUnmetCriteria.map((criterion) => `Satisfy: ${criterion}`);
newTasks = refinedUnmetCriteria;
Comment on lines 362 to +368
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an inconsistency in how tasks are generated. When gaps are identified (line 362), tasks are prefixed with "Address:", but when unmet criteria or refined unmet criteria are used (lines 365, 368), no prefix is added. This creates inconsistent task formatting in the follow-up issue.

For consistency, consider either:

  1. Removing the "Address:" prefix on line 362 to match the other cases (recommended based on the PR's rationale)
  2. Adding appropriate prefixes to lines 365 and 368 to match line 362

The first option aligns with the PR description's goal of removing redundant prefixes since task list items already imply they need work.

Copilot uses AI. Check for mistakes.
}
}

Expand Down
Loading