cairn: add CULL sweep (cull-candidates + eviction)#48
Merged
Conversation
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
cairn cull-candidatesreports entries that haven't been recalled in a while (default 30-day disuse threshold), independent of the existing freshness/anchor-drift check. Pairing it, a new evict path retires those entries: private (agent:-scope) entries are deleted directly, the same way other private mutations already commit straight to main; shared entries (role:/rig:/global:scope) are never deleted directly — evicting one only opens a review-branch proposal that a reviewer has to merge.Why built this way
Shared-tier entries are collectively owned, so a silent direct delete there is a materially bigger risk than deleting a private note. The scope-conditional guard in the evict path is a hard invariant, not a configurable default — there's no flag that lets a shared-tier entry bypass the review-branch proposal.
Review notes
cmd/cull.go:cairn cull-candidates(report) andcairn cull evict.internal/cairn/cull.go(candidate detection) andinternal/cairn/evict.go(EvictDirectvsEvictToReviewBranch, gated by scope).role:) entries are untouched by this feature — they keep their existing "light self-curation" policy.pinnedopt-out tag is deliberately not included in this pass — a reviewer can already reject any individual entry out of a shared-tier cull proposal, which covers "keep this one" for now.Bead
crn-whno — CULL sweep (cull-candidates + eviction), source review crn-28ge.1.7
Test plan
go build/go vet/gofmt/golangci-lint(cache-cleaned) all clean;go test ./... -race -count=1— 5 packages, zero regressionsrelease-gates/cairn-cull-sweep-gate.md