Skip to content

[business-logic] verify_coverage_gap: verifiedPkgs never written; multi-path verify commands only take first ./; bare 'go test' (scope .) covers nothing #417

Description

@topcheer

独立复核已实证(双确认,3 个同族缺陷合并立案)。

位置: internal/agent/verify_coverage_gap.go

1. verifiedPkgs 只声明从未写入(:59 声明;checkCoverage ~:109-169 全程只读)

  • 场景:依次运行 go test ./internal/agent/go test ./internal/config/,第二次警告称 internal/agent "remains UNVERIFIED"(实测 verifiedPkgs size=0)。逐包验证是合法策略却被连续误报,并消耗 warnCount 预算压掉真缺口。严重度:中。

2. scope 提取只取第一个 ./ 路径(~:288-302,遇空格截断)

  • 场景:go test ./internal/agent/ ./internal/config/ 的 scope 只解析为 internal/agent,config 被误报 UNVERIFIED。严重度:中。

3. scope=="." 恒返回 false(~:421-424)

  • 场景:cd 到包目录运行裸 go test,当前包确实已验证却被判零覆盖(实测 coveragePkgInScope("internal/agent", ".")==false)。严重度:中。

修复方向: checkCoverage 覆盖某包时写 verifiedPkgs;scope 改为集合收集全部 ./ token;scope "." 语义改为 cwd 包已验证。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions