Repository navigation
refactor(engine): killer 的上游复制段归零 - #284
Merged
Merged
Conversation
Target 把选择器与出生声明分开,Options 分成「覆盖范围 / 停止策略 / 观测」,unit 按选择、停止方式、锚点、身份证据和结果分组;engine 的 依赖按时间与存活、进程事实、信号适配器分组。 行为不变:目标解析、进程组优先、子先于父的排序和升级等待都保持原样。 Co-Authored-By: Claude Code <noreply@anthropic.com>
假时钟与信号记录重新组织,断言改用 slices 比较;真实进程夹具把 helper 的启动、pid 汇报与子进程派生拆开,进程树和忽略 SIGTERM 的用例覆盖不变。 Co-Authored-By: Claude Code <noreply@anthropic.com>
对照 26dbcae:总量 8,933 → 8,689 行 / 636 段、131 个文件(生产 3,478、 测试 5,211),internal/killer 整包归零。 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/killer按本项目的停止语义重写,审计(对照26dbcae)从 244 行降到 0:引擎总量 8,933 → 8,689 行 / 636 段 / 131 文件(生产 3,478,测试 5,211)。
重写内容
Target把选择器与出生声明分开,Options分成「覆盖范围 / 停止策略 / 观测」,unit按选择、停止方式、锚点、身份证据与结果分组;engine的依赖按时间与存活、进程事实、信号适配器分组。slices.ContainsFunc判定存活;matchPort、fillProcesses、probeWith的主机选择按条件重组。语义不变:进程组优先、子先于父、只有拒绝探测才算端口消失。slices;真实进程夹具把 helper 启动、pid 汇报与子进程派生拆开,进程树、忽略 SIGTERM、真实端口释放的用例覆盖不变。验证
go vet ./...go test -count=1 -timeout=8m ./...(全绿)go test -race -count=1 ./internal/killer/python3 scripts/audit-upstream-origin.py --upstream /tmp/sonar:killer 无输出,总量 8,689基于已合并的 #282;分支已同步
main。🤖 Generated with Claude Code