[dead-code] chore: remove dead functions — 6 functions removed#48201
[dead-code] chore: remove dead functions — 6 functions removed#48201github-actions[bot] wants to merge 1 commit into
Conversation
Remove 6 unreachable functions from pkg/intent/policy.go that had no callers in non-test production code: - PolicyCompiler.Compile - safestDefaultPolicy - PolicyRule.matches - deepCopyPolicy - mergePolicy - intersectAllowedTools Also remove their exclusive test functions from intent_formal_test.go (TestFormal_SafestPolicyFields, TestFormal_FailClosedForIndeterminate, TestFormal_PolicyDeterminism, TestFormal_StricterWinsForAutonomyAndWriteScope, TestFormal_AllowedToolsIntersection) and the now-unused require import. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Excellent work, Dead Code Removal Agent! 🤖 This PR looks great: ✅ Focused — Removes 6 unused policy functions with no side effects The dead-code analysis is correct:
|
|
/scout do a summary of all the mentions of intent in the source code. Is it a feature that can be plugged to logs or audit |
|
🏕️ Lost in the wilderness! Scout failed. Sending search party... |
Functions Removed
PolicyCompiler.Compilepkg/intent/policy.gosafestDefaultPolicypkg/intent/policy.goPolicyRule.matchespkg/intent/policy.godeepCopyPolicypkg/intent/policy.gomergePolicypkg/intent/policy.gointersectAllowedToolspkg/intent/policy.goAll six functions were flagged by
deadcodewith no callers in non-test production code. They are internally self-referencing (helpers called byPolicyCompiler.Compilewhich itself has only test callers).Tests Removed
TestFormal_SafestPolicyFieldsTestFormal_FailClosedForIndeterminateTestFormal_PolicyDeterminismTestFormal_StricterWinsForAutonomyAndWriteScopeTestFormal_AllowedToolsIntersectionAlso removed unused
requireimport fromintent_formal_test.go.Verification
go build ./...go vet ./...go vet -tags=integration ./...make fmtgo test ./pkg/intent/...— all passhttps://github.com/github/gh-aw/actions/runs/30206527520