fix(policy): surface all rule fields in CLI and Telegram listings#31
Merged
nnemirovsky merged 1 commit intomainfrom Apr 13, 2026
Merged
fix(policy): surface all rule fields in CLI and Telegram listings#31nnemirovsky merged 1 commit intomainfrom
nnemirovsky merged 1 commit intomainfrom
Conversation
Telegram `/policy show` only printed id, target, and ports. Protocols, replacement, name, and source were hidden, so scoped rules and redact substitutions were invisible to operators. CLI `policy list` also omitted replacement for redact rules. - `internal/telegram/commands.go`: add protocols to both store and snapshot paths. Store path also prints `-> "replacement"`, `(name)`, `[source]`. - `cmd/sluice/policy.go`: append `-> "replacement"` after protocols. - Tests: `TestPolicyShowIncludesAllFields`, `TestHandlePolicyListShowsReplacement`. API is unchanged, `storeRuleToAPI` already exposes every field.
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
Telegram
/policy showand CLIsluice policy listwere both hiding rule fields, so operators couldn't see protocols, replacement strings, or rule metadata from those surfaces. API was already complete viastoreRuleToAPI.Gaps before:
policy listreplacement(for redact rules)GET /api/rules/policy showprotocols,replacement,name,sourceGaps after: none.
Changes
internal/telegram/commands.go: bothpolicyShow(engine-snapshot fallback) andpolicyShowFromStorenow printprotocols=.... Store path also prints-> "replacement",(name),[source].cmd/sluice/policy.go:policy listnow prints-> "replacement"after protocols for redact rules.TestPolicyShowIncludesAllFields(Telegram),TestHandlePolicyListShowsReplacement(CLI).Test plan
go test ./...passes (12/12 packages)go build ./...cleangofumptclean/policyshows protocols for any scoped rule, source tags like[manual]/[approval]visiblesluice policy listshows replacement for a seeded redact rule