Skip to content

cairn: librarian PROMOTE + CULL candidate-bead sweep steps#49

Merged
quad341 merged 2 commits into
mainfrom
deploy/crn-28ge.1.8
Jul 24, 2026
Merged

cairn: librarian PROMOTE + CULL candidate-bead sweep steps#49
quad341 merged 2 commits into
mainfrom
deploy/crn-28ge.1.8

Conversation

@quad341

@quad341 quad341 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

What this changes

The mol-cairn-librarian formula (cairn's automated knowledge-base
maintenance sweep) gains two new steps, extending it from three to five:

  • promote-candidate-beads — when a cairn knowledge entry keeps
    recurring 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 gone
    unused 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

  • Both new steps are TOML-only; no Go code changed.
  • CULL's tier resolution (shell+jq) replicates
    internal/cairn/remember.go's ResolvedTier precedence (rig > role >
    agent > global fallback) — role- and agent-tier entries are explicitly
    out of scope for this sweep.
  • The loop step's needs chain and summary text were updated for the new
    five-step chain.

Test plan

  • go build ./..., go vet ./..., golangci-lint run ./... — clean
  • go test ./... -race — all packages green
  • Release gate: release-gates/librarian-promote-cull-steps-gate.md

quad341 added 2 commits July 24, 2026 07:57
…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.
@quad341
quad341 merged commit 4858187 into main Jul 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant