Remove the ai-assisted label when an edit drops the disclosure line

Keeps the label a deterministic mirror of the body's disclosure state,
per Greptile's P2 review finding on #518.

AI-assisted: written with an AI agent under maintainer direction.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Abdul Wahab
2026-08-05 22:30:04 +05:00
co-authored by Cursor
parent 38dc50108f
commit 281352ca53
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -181,6 +181,7 @@ export function evaluateIssue(issue, options = {}) {
const plan = { ...base, verdict, reasons };
plan.aiAssisted = AI_DISCLOSURE.test(body);
if (plan.aiAssisted && !labels.has(AI_LABEL)) plan.labelsToAdd.push(AI_LABEL);
if (!plan.aiAssisted && labels.has(AI_LABEL)) plan.labelsToRemove.push(AI_LABEL);
if (verdict === 'pass') {
if (labels.has(GATE_LABEL)) plan.labelsToRemove.push(GATE_LABEL);