From 7bc3392b0134dcb04fa939b78e2bcae844ce8758 Mon Sep 17 00:00:00 2001 From: Taras Mankovski <74687+taras@users.noreply.github.com> Date: Sat, 18 Jul 2026 19:53:41 -0400 Subject: [PATCH] fix(review): CommentReview redeclares checklist bindings instead of reassigning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bindings cross eval blocks as consts, so the final block's assignments to hasChecklist/checklistMd threw 'Assignment to constant variable' whenever the PR diff had enough comment/code pairs to reach that block — the Slop section of the review comment rendered the error instead of the checklist (seen on PR #87). Fresh const declarations shadow the injected bindings and their exports override env for the trailing . The block-1 let initializers stay: they cover the no-pairs path where the final block never runs. --- .reviews/components/CommentReview.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.reviews/components/CommentReview.md b/.reviews/components/CommentReview.md index 136015b..58eb660 100644 --- a/.reviews/components/CommentReview.md +++ b/.reviews/components/CommentReview.md @@ -242,8 +242,11 @@ for (const pf of pendingFindings) { }); } -hasChecklist = checklistItems.length > 0; -checklistMd = checklistItems.map(item => { +// Redeclared, not reassigned: bindings from earlier eval blocks arrive in +// later blocks as consts, so assignment throws. A fresh declaration shadows +// the injected binding and its export overrides env for the below. +const hasChecklist = checklistItems.length > 0; +const checklistMd = checklistItems.map(item => { const checked = item.status !== "pending" ? "x" : " "; if (item.status === "applied") { return `- [${checked}] \`${item.file}:${item.lineNumber}\` (removed)`;