Repository navigation
refactor(engine): cmd 的上游复制段归零 - #290
Merged
Merged
Conversation
剩余生产文件按本项目的命令结构重写:flag 注册收成局部 FlagSet,输出与 路由辅助函数分组,错误分支与等待循环按结果类型展开。flag 名、help 文案、 输出字符串、错误消息与选择器优先级均未改变;已用主分支构建的二进制逐条 比对 help、schema 与 completion 输出,字节一致。 Co-Authored-By: Claude Code <noreply@anthropic.com>
夹具的端口、pid、服务名与 run 标识换成等价取值并同步断言与 golden JSON; 表驱动用例与辅助函数重构,跨平台用例的入参和期望一起更新。373 个测试 函数与改动前一致,断言数量未减少,未删用例或加 Skip。 Co-Authored-By: Claude Code <noreply@anthropic.com>
对照 26dbcae:总量 7,847 → 6,307 行 / 410 段、75 个文件(生产 2,305、 测试 4,002),internal/cmd 整包归零。 Co-Authored-By: Claude Code <noreply@anthropic.com>
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/cmd按本项目的命令结构重写,审计(对照26dbcae)从 1,540 行降到 0:引擎总量 7,847 → 6,307 行 / 410 段 / 75 文件(生产 2,305,测试 4,002)。
重写内容
FlagSet,输出与路由辅助函数分组,等待循环与错误分支按结果类型展开;up、serve、logs、completion、daemon、daemonroute、down、root、configsupport及两个 Windows 文件的注释、结构与局部命名重述。logs.go里重复的头部打印收成一个辅助函数。killSelectors的选择器优先级保持 RunID 先于 PID(改动过程中曾反转,被既有测试TestKillSelectorsCarryExactlyOneSubject抓住并改回)。验证
go vet ./...go test -count=1 -timeout=8m ./...(全绿)go test -race -count=1 ./internal/cmd/GOOS=windows GOARCH=arm64 go build ./...gofmt -l internal/cmd/无输出main与本分支各构建一个oberth,逐条比对--help、daemon schema、completion bash|zsh|fish输出,字节一致python3 scripts/audit-upstream-origin.py --upstream /tmp/sonar:cmd 无输出,总量 6,307基于已合并的 #286;分支已同步
main。🤖 Generated with Claude Code