fix(review): CommentReview redeclares checklist bindings instead of reassigning#91
Merged
Conversation
…eassigning 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 <Show>. The block-1 let initializers stay: they cover the no-pairs path where the final block never runs.
PR #91: fix(review): CommentReview redeclares checklist bindings instead of reassigning1 files, +5 / -2 Scope✅ PR scope looks good. Structural✅ No structural bloat detected. Slop✅ Slop indicators look low. Static Analysis✅ Oxlint found no issues. Correctness✅ Small PR — correctness review skipped. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
PR #87's review comment renders
<!-- ERROR: Assignment to constant variable. -->in its Slop section instead of the comment-review checklist.
CommentReview.mddeclareslet hasChecklist/let checklistMdin its firsteval block and assigns them in its final eval block — but bindings cross eval
blocks as consts, so the assignment throws. The failure is data-dependent: the
final block sits inside
<Show when={hasPairs}>and only runs when the PRdiff has three or more comment/code pairs.
Approach
The final block redeclares the two bindings as fresh consts instead of
assigning: a block-local declaration shadows the injected binding, and the
block's exports override
envfor the trailing<Show when={hasChecklist}>.The first block's
letinitializers stay — they cover the no-pairs path wherethe final block never runs.
Verified with minimal two-block documents against the compiled binary: the
reassignment pattern reproduces the exact error (with stale binding values
downstream), and the redeclaration pattern renders the updated values. An
audit of
.reviews/found no other cross-block reassignment(
Pattern.md'sre.lastIndex = 0is a property mutation;DispatchRepoAnalysis.mdreassigns within a single block). FullCommentReviewneeds the CI LLM provider, so the next PR review run is theend-to-end confirmation.
Scope confirmation
New abstractions (if any)
None.
New dependencies (if any)
None.
New tests (if any)
None — verified via repro documents against the binary; lint/typecheck/tests
remain green (no
.tstouched).