Skip to content

[business-logic] type_switch_check is dead code (absent from write_integrity's registry, tests green via direct calls); #1436-A's errorRecoverySignals covers 3 of 9 edit tools so failed write_file retries get no effort bump; hedging HIGH/MEDIUM regex overlap double-counts a single sentence to threshold #1516

Description

@topcheer

文件行号

internal/agent/type_switch_check.go L62(checkTypeSwitchExhaustive 定义——grep 全仓仅定义+type_switch_check_test.go 14 处测试调用,非测试调用点为零)+ write_integrity.go init 共 70 条注册(L399 "typosquat"/L357 "unchecked-type-assert"→另一函数,无 type-switch 条目)+ L172-181(#1212 dedup-key 修复注释——"修死代码"自证);adaptive_effort.go L93-97(errorRecoverySignals 仅 edit_file/multi_edit_file/multi_file_edit 3 成员)对照 verify_hint.go L41-51(sourceMutatingTools 9 成员含 write_file/multi_file_write/batch_replace/lsp_rename/file_ops/notebook_edit)+ L89(editTools = sourceMutatingTools 别名)+ L184(同一 map 用于 editCount)+ L171/L179(isError 分支集合不含 → continue 连 editCount 也不计 → 返回 "");action_hedging.go L89-90(HIGH \bthis might (?:fix|work|resolv|be|not)\b/\bthis may ...\b)↔ L112(MEDIUM \bI think this (?:should|will|might|could|may)\b)+ L115("see if works")+ L68(threshold 2)+ L181(dedup key = level+":"+excerpt——跨 level 必不折叠)+ L96-99(#1436-C 注释自认同类 bug 只删一个 literal)

问题

案 A(High·green-build illusion):type_switch_check 从未注册——检测器零执行

案 B(Med·修复引入的窄化):errorRecoverySignals 与 editTools 失同步——write_file 失败重试不升 effort

  • write_file sandbox 拒绝 → isError 分支集合不含 → 连 editCount 也不计 → 返回 ""(无适配)——违背模块头 "recent edit failures → high";同一 editTools 4 行后用于 editCount 证明集合本应同源;测试只 pin edit_file/grep 两极
    :errorRecoverySignals := editTools(同源)或补齐 6 个缺失工具 + write_file 失败用例。

案 C(Low-Med·双计残留):hedging HIGH/MEDIUM 正则交叠——单句单 hedge 即达阈值

#1436 修复区验证结论(stale 重审)

干净项

typosquat_check:接线在位(write_integrity.go:399)/#567 双解析差集只报新增/exact 同名跳过/len≥4 挡短名/levenshtein 经典正确——观察 LOW 不立案(近名理论 FP 罕见/scoped 包 by design 盲区)。action_hedging 其余:与 assumption_track 分工清晰/hasMutation 计算正确/接线 agent.go:2832/#1436-C 本体验证无误。action_annihilate 其余:undo_edit #744 在位/窗口 20/上限 2/先 check 后入窗全对。

排除

#1442-#1515 各案;#1212/#738/#567/#359/#744 已修项;checkout 往返 fire 属设计意图(限幅内)。

严重程度

High + Med + Low-Med


独立复核确认:grep 穷尽(全仓符号+注册表 70 条清单)、双集合 9 vs 3 对照+同源证据、正则交叠与叙述误报 /tmp 机械验证、测试缺口逐一证实。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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