cairn: librarian PROMOTE + CULL candidate-bead sweep steps#49
Merged
Conversation
…rn-28ge.1.8) Add promote-candidate-beads and cull-candidate-beads steps to both mol-cairn-librarian.formula.toml and mol-cairn-librarian-rig.formula.toml, following the existing three steps' idempotent-bead-filing shape. PROMOTE consumes `cairn promote-candidates` (crn-28ge.1.6) and files a local fix-proposal bead per finding, with anchor_repo surfaced via title and a target-repo label rather than attempting an unsupported cross-repo bd write (no mechanism exists for that; mirrors cmd/critic_filebead.go's precedent). CULL consumes `cairn cull-candidates` (crn-28ge.1.7), filters to rig/global tier by replicating ResolvedTier's precedence in shell, and triggers `cairn cull-evict`'s review-branch proposal path -- deduplicated before the call, since EvictToReviewBranch hard-errors on a repeat call for the same entry rather than no-op'ing. loop step's needs chain and summary prose updated for five steps.
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.
What this changes
The
mol-cairn-librarianformula (cairn's automated knowledge-basemaintenance sweep) gains two new steps, extending it from three to five:
promote-candidate-beads— when a cairn knowledge entry keepsrecurring past a threshold, file a proposal bead recommending a durable
code fix in the repo the finding names, rather than letting the same
finding silently resurface every cycle.
cull-candidate-beads— when a rig- or global-tier entry has goneunused past the disuse threshold, propose retiring it via a review-branch
eviction — never a direct delete. A human reviewer still has to merge the
branch for anything to actually go away.
Both steps reuse the exact idempotent-bead-filing pattern the sweep's three
existing steps already use: run a read-only detector, check for an
already-filed proposal before creating a new one, and tally filed/skipped
counts. Running either step twice against unchanged findings files nothing
twice.
Why built this way
PROMOTE's target repo is often not the repo the sweep happens to be running
in, and there's no general mechanism to file a bead directly into an
arbitrary named repo's own tracker — so this step files the proposal
locally with the target repo called out explicitly in the title and a
label, and leaves cross-repo routing to the normal triage pipeline rather
than guessing at an unsupported cross-store write.
CULL only ever proposes eviction via a review branch (opens a branch and
mails the tier's reviewer); nothing is actually removed until a human
merges it. This preserves the formula's existing charter — read-only
against cairn, proposal-only against bd — rather than loosening it.
Review notes
internal/cairn/remember.go'sResolvedTierprecedence (rig > role >agent > global fallback) — role- and agent-tier entries are explicitly
out of scope for this sweep.
loopstep'sneedschain and summary text were updated for the newfive-step chain.
Test plan
go build ./...,go vet ./...,golangci-lint run ./...— cleango test ./... -race— all packages greenrelease-gates/librarian-promote-cull-steps-gate.md