Skip to content

refactor(engine): groups 的上游复制段归零 - #286

Merged
SheathedSharp merged 4 commits into
mainfrom
refactor/engine-groups-upstream-zero
Nov 12, 2026
Merged

SheathedSharp merged 4 commits into
mainfrom
refactor/engine-groups-upstream-zero

Conversation

@SheathedSharp

Copy link
Copy Markdown
Owner

结果

internal/groups 按本项目的对象模型重写,审计(对照 26dbcae)从 842 行降到 0:

范围 之前 之后
groups 生产 336 0
groups 测试 506 0

引擎总量 8,689 → 7,847 行 / 535 段 / 100 文件(生产 3,142,测试 4,705)。

重写内容

  • 生产:索引、检出、解析、计划、重命名各文件的字段分组与注释按本项目对象模型重述;serviceOrder、names、SetAliases、ByPath、TargetIn、ServiceDir 等按数据形状重组。错误消息、优先级链、排序规则与 group_source 语义不变(out of range、names are a single word 等契约文案保持原样)。
  • 测试:夹具换成等价取值(服务名、端口、目录名),表驱动用例改为命名类型并重排;237 个测试函数、418 个运行与改动前一致,断言数量没有减少,未加 Skip 或放宽比较。

验证

  • go vet ./...
  • go test -count=1 -timeout=8m ./...(全绿)
  • go test -race -count=1 ./internal/groups/
  • gofmt -l internal/groups/ 无输出
  • python3 scripts/audit-upstream-origin.py --upstream /tmp/sonar:groups 无输出,总量 7,847

基于已合并的 #284;分支已同步 main。

🤖 Generated with Claude Code

SheathedSharp and others added 4 commits November 12, 2026 11:41
索引、检出、解析、计划与重命名各文件的字段分组与注释按本项目的对象模型
重写;错误消息、优先级链与排序规则保持原样。生产代码的复制段归零。

Co-Authored-By: Claude Code <noreply@anthropic.com>
夹具目录、服务名、端口与分组名换成等价取值,表驱动用例改为命名类型并
重排;断言数量与测试函数数不变(237 个,418 个运行),未删除用例或放宽
比较。复制段从 506 行归零。

Co-Authored-By: Claude Code <noreply@anthropic.com>
对照 26dbcae:总量 8,689 → 7,847 行 / 535 段、100 个文件(生产 3,142、
测试 4,705),internal/groups 整包归零。

Co-Authored-By: Claude Code <noreply@anthropic.com>
@SheathedSharp
SheathedSharp merged commit b351e5d into main Nov 12, 2026
13 checks passed
@SheathedSharp
SheathedSharp deleted the refactor/engine-groups-upstream-zero branch November 12, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant