Repository navigation
refactor(engine): scanner 与 store 的上游复制段归零 - #291
Merged
Merged
Conversation
扫描循环的注释、keyed 字面量字段与局部命名重述,Wake 的两处非阻塞通知 收成 nudge;scannedSince 的持锁段抽成 cachedCommittedAfter。计时常量、 select/timer 语义、锁的获取顺序与提交字段顺序均未改变。store 把清理 SQL 提为常量,迁移行集的关闭点随所有权下移。 Co-Authored-By: Claude Code <noreply@anthropic.com>
端口、pid、解释器与服务名换成等价取值并同步断言;辅助函数与表驱动用例 重构,闭包与 channel 命名按实际动作命名。测试函数数(scanner 240、 store 71)与断言数均与改动前一致,未删用例或加 Skip。 Co-Authored-By: Claude Code <noreply@anthropic.com>
对照 26dbcae:总量 6,307 → 5,530 行 / 328 段、60 个文件(生产 2,073、 测试 3,457)。除 internal/daemon 外各包已归零。 Co-Authored-By: Claude Code <noreply@anthropic.com>
SheathedSharp
deleted the
refactor/engine-scanner-store-upstream-zero
branch
November 12, 2026 07:28
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.
结果
internal/scanner与internal/store按本项目对象模型重写,审计(对照26dbcae):引擎总量 6,307 → 5,530 行 / 328 段 / 60 文件(生产 2,073,测试 3,457)。剩余复制段全部在
internal/daemon。重写内容
Wake的两处非阻塞通知收成nudge;scannedSince的持锁段抽成cachedCommittedAfter;preferHost的 IPv6 判定抽成ipv6OnlyBind。计时常量、select/timer 语义、锁的获取顺序、提交字段与发布判定均未改变。scanVersions。验证
go vet ./...go test -count=1 -timeout=8m ./...(39 包全绿)go test -race -count=1 -timeout=10m ./internal/scanner/ ./internal/store/(连跑两遍,无 race 报告)gofmt -w已执行;改动文件无格式问题python3 scripts/audit-upstream-origin.py --upstream /tmp/sonar:scanner、store 无输出,总量 5,530基于已合并的 #290;分支已同步
main。🤖 Generated with Claude Code