fix: keep PR comments under GitHub's 65 KB limit and guard AI verdicts#30
Merged
Merged
Conversation
- Markdown reporter truncates oversized before/after snippets to head + tail in a <details> block (snippetMaxLines, default 60). - Rule-based diff descriptions summarize large type literals; the diff block already carries the full body. - AI reviewer coerces an 'addition' verdict on an in-place modification to 'non-breaking'. 'addition' is reserved for brand-new exports.
commit: |
Contributor
API Changes Report
Summary
@clerk/snapiCurrent version: 0.0.1 🟢 Additions (1)Added:
|
…d-ai-verdict-guard # Conflicts: # src/reporters/markdown.ts
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.
Investigated clerk/javascript#8675's snapi comment, which arrived truncated at GitHub's 65,536-char limit (the AI's per-change rationale never made it into the rendered output). Three things were stacking up to blow the budget on a single change to
@clerk/ui'sElementsConfig.The reporter dumps the entire before- and after-snippet of every change, which is ~13KB twice for a type with ~500 keys. The rule-based diff also stuffs both copies of the type literal back into the change's
description. And the AI returnedtype: "addition"on an in-place modification, mislabeling the section as "Added" even thoughElementsConfigalready existed.Fixes one per problem. The interesting one is the AI guard at
src/analyzers/ai-analyzer.ts:329-345:additionis reserved for brand-new exports (the prompt is explicit about this and the rule-based pass already routes those around the model), so anadditionverdict for areviewablechange is a protocol violation. We coerce tonon-breakingand warn. The other two are mechanical: head/tail elision pastsnippetMaxLinesin the markdown reporter, and a 120-char summary for type literals in the rule-based description.