Clean duplicate active preview receipts#36
Merged
Conversation
Repeated safe plan refreshes can leave several active preview receipts for the same request, which makes maildesk sender-domain readiness look noisier than it is. Add a cfctl previews purge-duplicate-active subcommand that groups active trusted receipts by lane plus policy/request/target fingerprints, keeps the newest receipt, and removes only older local artifacts. Expired and legacy cleanup remain separate paths. Extend the static and public contract checks plus README/runbook/runtime-policy docs so the new cleanup stays discoverable and remains clearly outside Cloudflare mutation. Risk is limited to local ignored preview inventory cleanup; ack-plan writes are unchanged.
Owner
Author
|
@codex Please review the duplicate-active preview cleanup semantics: should the dedupe key remain lane + policy/request/target fingerprints without operation_id, and should expired receipts continue to be excluded so purge-expired remains the only expired-preview deletion path? |
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
cfctl previews purge-duplicate-activefor local preview inventory cleanup after repeated plan refreshes.cfctl previewssurface.Behavioral Changes
cfctl previewsrows now include trust fingerprints in the result payload.purge-duplicate-activereportspurged_count,duplicate_group_count, and removed receipt metadata.--ack-planor mutate Cloudflare.Implications
--planrefreshes can be compacted without losing the newest actionable operation id for a concrete request.Risk Areas / Confidence
Test Plan
./scripts/verify_static_contract.shpython3 scripts/verify_permission_catalog.py --cfctl ./cfctl./cfctl previews purge-duplicate-active | jq '.summary'./cfctl previews purge-expired | jq '.summary'./cfctl doctor | jq '.summary'./cfctl previews | jq '.summary'Review Focus
operation_id, since that is the value repeated plan refreshes intentionally change.purge-expiredrather than being removed by duplicate-active cleanup.Next Steps
--ack-plansender-domain mutation remains outside this PR and still needs explicit operator approval.