Repository navigation
fix(review): expand review budget for 1M context and refine shared context pattern - #61
Merged
Merged
Conversation
…ntext pattern - Refine contextPattern so only manifests and entrypoints (dsh/index.*, package.json, etc.) are treated as shared context - Increase MAX_CONTEXT_SIZE to 500k, MAX_BATCH_SIZE to 1M, and MAX_REQUEST_CHARS to 1.5M to utilize 1M token context - Update unit tests and security review documentation
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.
变更背景与原因
在自动化安全审查门禁中,部分 PR(如 #59)出现
共享审核上下文超出预算,需人工处理阻断。排查发现存在两个问题:contextPattern匹配所有dsh/.*,导致若投稿将业务代码置于dsh/目录下,会被全部作为共享上下文(基础元数据)打包进每次请求,导致基础上下文激增。改动内容
scripts/llm-review.mjs):contextPattern中的dsh/.*调整为限定入口/契约文件:dsh/(?:index\.[cm]?[jt]sx?|manifest\.json)。pieces)正常分块审查。MAX_CONTEXT_SIZE从 100k 放宽至 500k 字符。MAX_BATCH_SIZE从 150k 放宽至 1,000,000 字符。MAX_REQUEST_CHARS从 230k 放宽至 1,500,000 字符。test/security-review.test.mjs:调整分块边界断言,并新增针对dsh/业务代码分块及入口识别的专项测试。全部 106 项单测通过。docs/security-review.md:同步更新规范文档中的字符上限说明。