fix: reduce board audit noise

This commit is contained in:
Codex
2026-05-20 21:54:55 +00:00
parent 021a9eef01
commit 27b14bef76
4 changed files with 91 additions and 16 deletions
+19 -5
View File
@@ -1228,11 +1228,19 @@ function boardHeaderColumnKind(header: string): BoardRequiredColumn | null {
const normalized = normalizeBoardHeader(header);
if (["branch", "", "", ""].includes(normalized)) return "branch";
if (["acceptance", "", "", "", ""].includes(normalized)) return "acceptance";
if (["relatedtask", "task", "codequeue", "codequeuetask", "", "", "codequeue任务", "cq任务"].includes(normalized)) return "relatedTask";
if (["relatedtask", "task", "codequeue", "codequeuetask", "", "", "codequeue任务", "cq任务", "codequeue任务", "codequeuetask"].includes(normalized)) return "relatedTask";
if (["progress", "", "", ""].includes(normalized)) return "progress";
return null;
}
function boardIssueColumnIndex(headers: string[]): number | null {
for (let index = 0; index < headers.length; index += 1) {
const normalized = normalizeBoardHeader(headers[index]);
if (["issue", "issue#", "issuenumber", "issueid", "issue编号", "issue号", ""].includes(normalized)) return index;
}
return null;
}
function markdownCells(line: string): string[] {
const trimmed = line.trim();
const withoutOuterPipes = trimmed.replace(/^\|/u, "").replace(/\|$/u, "");
@@ -1303,12 +1311,14 @@ function parseBoardTables(body: string): { sections: BoardTableSection[]; warnin
const kind = boardHeaderColumnKind(header);
if (kind !== null && !columnMap.has(kind)) columnMap.set(kind, headerIndex);
});
const issueColumnIndex = boardIssueColumnIndex(headers);
const rows: BoardTableRow[] = [];
let rowIndex = index + 2;
while (rowIndex < lines.length && lines[rowIndex].trim().startsWith("|")) {
if (!isMarkdownTableSeparator(lines[rowIndex])) {
const cells = markdownCells(lines[rowIndex]);
const issueNumbers = extractIssueNumbers(lines[rowIndex]);
const issueCell = issueColumnIndex === null ? undefined : cells[issueColumnIndex];
const issueNumbers = issueColumnIndex === null ? extractIssueNumbers(lines[rowIndex]) : extractIssueNumbers(issueCell ?? "");
const columns: Partial<Record<BoardRequiredColumn, string>> = {};
for (const column of BOARD_AUDIT_REQUIRED_COLUMNS) {
const cellIndex = columnMap.get(column);
@@ -1321,7 +1331,9 @@ function parseBoardTables(body: string): { sections: BoardTableSection[]; warnin
cells,
issueNumbers,
issueNumber: issueNumbers[0] ?? null,
title: cells.find((cell) => extractIssueNumbers(cell).length > 0) ?? cells[0] ?? null,
title: issueColumnIndex === null
? (cells.find((cell) => extractIssueNumbers(cell).length > 0) ?? cells[0] ?? null)
: (issueCell ?? cells[0] ?? null),
columns,
};
rows.push(row);
@@ -1341,7 +1353,9 @@ function parseBoardTables(body: string): { sections: BoardTableSection[]; warnin
section: currentKind,
lineNumber: row.lineNumber,
kind: "multiple-issue-references",
message: "Board table row contains multiple issue references; audit uses the first number as the row key.",
message: issueColumnIndex === null
? "Board table row contains multiple issue references; audit uses the first number as the row key."
: "Board table row contains multiple issue references in the Issue column; audit uses the first number as the row key.",
rowPreview: preview(row.raw),
});
}
@@ -2862,7 +2876,7 @@ export function ghHelp(): unknown {
"When staging a body file from a shell, use a quoted heredoc such as cat <<'EOF' > /tmp/body.md so backticks and backslashes are not expanded before --body-file reads the file.",
"For JSON request bodies in other CLI namespaces, prefer --body-file or --body-stdin over long inline shell arguments; GitHub Markdown writes intentionally use --body-file only.",
"issue scan-escape classifies literal \\n findings as suspected-pollution, explanatory-mention, or risk, and emits cleanupSuggestions with body/comment ids plus diff-like previews. cleanup-plan is an alias that remains dry-run/read-only.",
"issue board-audit is read-only and defaults to repo pikasTech/unidesk plus board issue #20. It compares GitHub open/closed issue lists with the board OPEN/CLOSED tables and reports missingOpenIssues, closedInOpenRows, missingClosedRows, rowValidationWarnings, ignoredIssues, and recommendedActions. #20 and #24 are known meta issues by default.",
"issue board-audit is read-only and defaults to repo pikasTech/unidesk plus board issue #20. It compares GitHub open/closed issue lists with the board OPEN/CLOSED tables and reports missingOpenIssues, closedInOpenRows, missingClosedRows, rowValidationWarnings, ignoredIssues, and recommendedActions. When an Issue column exists, row.issueNumber is taken from that column; #20 and #24 are known meta issues by default.",
"issue edit 24 --notify-claudeqq-brief-diff reads the old issue body, PATCHes the new body, and sends only newly added '## ... ' sections to ClaudeQQ; ClaudeQQ failure does not roll back GitHub.",
"Commander brief ClaudeQQ defaults to private target 645275593 through backend-core /api/microservices/claudeqq/proxy; UNIDESK_COMMANDER_BRIEF_CLAUDEQQ_* env vars can override target, base URL, timeout, and enabled state.",
"comment delete is supported because GitHub supports deleting issue comments; issue/pr hard delete is unsupported and close is the lifecycle alternative.",