[AUTOMATION] feat: clean up internal decision handling#293
Closed
michiosw wants to merge 1 commit into
Closed
Conversation
Greptile SummaryThis PR centralizes internal guard decision normalization. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "feat: clean up internal decision handlin..." | Re-trigger Greptile |
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.

Summary
This cleans up internal decision handling by routing allow and deny normalization through the existing shared helpers.
Before this, internal/hook/domain.go and internal/guard/store/sqlite/store.go each carried their own decision definitions or normalization logic, which made the same internal concept easy to drift.
Now internal decision handling has one canonical path:
risk.Decision input
-> hook.NormalizeDecision
-> canonical hook and sqlite storage values
-> consistent allow or deny output
Why
This gives kontext-cli a cleaner maintenance path for internal guard decision handling.
What changed
Consolidated the hook Decision type onto internal/guard/decision
Removed duplicated allow and deny normalization in the SQLite store
Added tests for mixed-case and whitespace-padded decision values
Verification
go test ./internal/hook ./internal/guard/store/sqlite ./internal/guard/app/server ./internal/guard/hookruntime
go test ./internal/guard/judge
go test ./...
git diff --check