Standalone retention and neighbor-duplication commands
Type: reference/types/design-proposal.md · Tags: review-system, curation
commonplace-revise --full assumes the target note deserves to remain in the knowledge base and inspects only the note, its linked sources, and the passages of files that already link to it. Two failures observed during old-note hygiene audits therefore fall outside --full:
- Missing retention value. A locally true, well-formed note can have no surviving reader or decision under
AGENTS.mdand current open gaps. Without a purpose supplied by the operator, the assessor invents one and polishes the text rather than questioning whether the note earns its maintenance and attention cost. - Unlinked neighbor duplication or supersession. The role report checks duplication only against files that already link to the note, and only from their citing passages. A note whose surviving core is already stated more cleanly across unlinked neighbors gets revised in place instead of merged or retired.
The outcome sought is a repeatable, inspectable way to test both questions before deciding whether to spend revision passes on a note, without adding unvalidated latency or false-positive stops to commonplace-revise --full. The candidate change is to trial retention assessment and unlinked-neighbor duplication as standalone, read-only commands (or opt-in commonplace-review report criteria) first, measure their precision and cost on real notes, and leave --full integration as a separate later decision.
Current state (as of 2026-11-28)
- Shipped revision pipeline (ADR 135, ADR 139, review architecture).
commonplace-revise NOTE --fullruns all depth-declaring catalog gates,type,collection, the four compression checks,critique,friction,premises,compression-synthesis, androle, then passes their outputs to one assessor (revise-an-article-or-note.md). Onlycommonplace-revisewrites notes;commonplace-reviewis read-only. - Role report boundary.
commonplace-review NOTE --criteria rolereceives the note plusinbound.collect()(local files underkb/that link to the note, prioritized live dependents first, then dated source records, then frozen historical/archived records). By contract,roleforbids opening linking files or searching for other links, and disclaims judging whether a claim earns retention. - Collection placement and priors.
--fullcatches collection/form placement failures via thecollectionconformance review (which now routes placement failures to a plan stop) and catches extended generic restatements against strong-model priors viacompression/marginal-value-redundancy. Neither check searches unlinked neighbors or evaluates KB-wide retention value againstAGENTS.mdand standing questions. - Discovery and retirement exist outside
--full. cp-skill-connect runs repo-wide discovery for one artifact and writes a gitignoredconnect-reportunderkb/workflow-state/data/current/connect/. retire-artifact.md executes operator-approved deletion or archiving, including the claim-extraction gate that requires reading each named successor's actual text. - Manual precedent. Recent old-note hygiene audits ran retention and unlinked-neighbor checks manually with an ad hoc triage prompt; in one batch, searching unlinked neighbors surfaced four stronger notes that subsumed a note's surviving claims and led to retirement rather than in-place revision. No standalone command or retained workflow observation exists for either check.
Boundary commitments
Any trial command in this space inherits four boundaries:
- Read-only on library artifacts (ADR 139). Neither command edits, relocates, or retires notes. Both emit a report or typed review observation; retirement remains an explicit operator-approved step through retire-artifact.md.
- Text-grounded successor claims. A duplication or supersession finding must quote or cite specific passages from the candidate neighbor's actual text. Titles, descriptions, or search snippets alone cannot justify claiming another note covers the target.
- Corpus-dependent inputs stay outside two-input freshness. Both checks depend on repo-wide state (
AGENTS.md, standing questions, or candidate neighbors across collections). Following review architecture, neither publishes a freshness-cached current result; each run records its captured operational inputs in its run directory. - No silent policy coupling to
--full. Routinecommonplace-revise --fullruns keep their current trigger and stop surface during the trial.
Option space
Option A — Two separate standalone read-only checks (recommended trial shape)
Split the two questions into independent report-only commands (either opt-in commonplace-review criteria under criteria.SUPPLIED or subcommands of a small read-only CLI):
- Retention / KB-value check (illustrative invocation:
commonplace-review NOTE --criteria retention). - Inputs: the note,
AGENTS.md(KB purpose and scope), the note'sCOLLECTION.md, an optional bundle of standing questions (e.g.kb/theory/questions/*.mdwhen present, or operator-supplied--input), andinbound.collect(). - Output: a report naming the concrete reader and decision the note changes (or
none), which active open questions or standing decisions it serves, and an advisory disposition (keep,narrow-or-recast,retire-candidate), explicitly separating low inbound count from low value so foundational or newly written notes are not flagged merely for having few citers. - Unlinked-neighbor duplication check (illustrative invocation:
commonplace-review NOTE --criteria neighbors). - Stage 1 (candidate retrieval): gather a bounded shortlist of candidate neighbors outside the note's existing inbound linkers — e.g., deterministic lexical/title-and-description matching in Python or a read-only search step over authorized collections (
kb/theory/,kb/reference/,kb/instructions/,kb/notes/) — and record the exact candidate list and texts as operational inputs. - Stage 2 (comparative reading): a fresh worker reads the target note and the retrieved neighbor texts and classifies each material overlap as
subsumed-by,partially-overlaps,complementary, orcontradicts, quoting the passages that establish the relation and noting any unique detail in the target that no neighbor carries.
Consequences: Separating the two checks keeps failure modes, prompts, token cost, and evaluation metrics independent. An operator can run retention alone on an old note with obvious neighbors, or run neighbor duplication alone before deciding whether to merge two clusters.
Option B — One combined pre-revision triage command
Provide a single command (illustrative invocation: commonplace-triage NOTE) that gathers AGENTS.md, standing questions, inbound.collect(), and candidate neighbors in one pass and emits a single disposition (keep-unchanged, targeted-update, rebuild-in-place, relocate-and-recast, merge-or-retire-duplicate, retire-obsolete, verify-before-deciding).
Consequences: Fewer invocations during bulk hygiene sweeps, and one unified recommendation for an operator to act on. However, combining both checks in one prompt conflates two distinct judgments (whether a claim has a KB reader vs. whether another file already carries it), increases context size per call, and makes it harder to tell whether poor precision comes from bad neighbor retrieval or noisy value judgments.
Option C — Reuse cp-skill-connect for neighbor retrieval plus a slim duplication synthesis
Instead of building a second repo-wide search mechanism, feed an existing or freshly generated connect-report (plus the full texts of its top candidates) into a duplication-comparison worker, while keeping the retention check separate.
Consequences: Avoids duplicating search logic and leverages cp-skill-connect's collection-aware discovery trace. The structural catch is objective mismatch: cp-skill-connect prospects for useful outbound links (complementary notes a reader should follow), whereas duplicate detection needs rivals and near-identical claims that a writer would not normally link. Relying on connect alone risks systematically missing duplicates unless connect adds a dedicated rival/duplicate prospecting pass.
Rival decomposition — Keep both as interactive hygiene skills, not CLI commands
Under the same boundary commitments, keep retention and neighbor-duplication as an authored instruction or skill run interactively during periodic hygiene audits (like the current old-note triage procedure) rather than adding CLI commands or headless workflow criteria.
Consequences: Zero Python maintenance and natural access to interactive rg/reading follow-ups when a first search misses a synonym. The cost is weak comparability: interactive sessions do not produce uniform retained observations, captured input hashes, or replayable fixtures, making it harder to calibrate false-positive rates across prompt revisions or model upgrades.
Operativity and oracle warrant
- Operativity path. During the trial, the operator invokes the standalone command(s) explicitly during hygiene sweeps or before running
commonplace-revise --fullon a suspect note. Outputs are read-only reports consumed by the operator (or a session agent presenting them to the operator) to choose amongcommonplace-revise --full,commonplace-revise rewrite, relocation, or retire-artifact.md. Nothing runs automatically on commits or inside--full. - Where the oracle's warrant stops.
- Retention check: Reading
AGENTS.md, standing questions, and current inbound links cannot prove that a sound claim has no future reader or unlinked use. A note that states a foundational boundary before dependents cite it can look "unused" to a model biased toward active gaps. The report is therefore routed attention, never an automatic deletion verdict. - Neighbor-duplication check: Recall is bounded by the candidate-retrieval stage. Lexical or title-based retrieval misses a stronger successor phrased in different vocabulary (especially across historical terminology shifts). A "no duplicate found" report bounds only the inspected candidate set and must list which candidates were checked. Conversely, precision can be kept high by requiring quoted passages from any named successor.
Feasibility, commitment scope, and open choices
- Feasibility.
commonplace-reviewalready supports operational-input report criteria viacriteria.SUPPLIED(roleandcompression-synthesisin review architecture), capturing exact inputs underkb/workflow-state/data/current/review/runs/v2/without touching the freshness store. Adding one or two new read-only criteria (or a thin wrapper command over the same runner) reuses Workjig execution, observation capture, and--fixturereplay with minimal new code. - Commitment scope (cheap, reversible trial). Because nothing in
--full,--quick,triage,rewrite, orcommonplace-validatedepends on the trial commands, adding them commits no downstream consumer. If trial precision or yield is poor, deleting the criterion file and its small input-collector leaves the rest of the review system intact. - Choices still open before implementation:
- CLI surface: new opt-in criteria on
commonplace-review --criteria retention|neighbors(reusing existingshow, observation layout, and fixtures) vs. a dedicatedcommonplace-triagecommand that frames retention + duplication explicitly as curation rather than single-note review. - Neighbor retrieval mechanism: deterministic Python candidate collector (e.g., title/description + TF-IDF/keyword overlap over authorized collections, zero extra model calls, fully reproducible inputs) vs. a read-only agent search step using
rg(better synonym handling, harder to cap and capture). - Project portability for standing questions: Commonplace's checkout has
kb/theory/questions/, whereas installed projects may have different collection layouts. The retention collector should accept explicit--inputpaths or optional configured goal/question files rather than hard-codingkb/theory/questions/. - Combined summary: whether to add a lightweight wrapper after trying Option A's two checks separately, or keep them permanently separate.
Adoption criteria
- To ship the trial (Option A): select the CLI surface and neighbor-retrieval mechanism above, then implement both checks as read-only commands with retained run observations and no changes to
--full. - To judge the trial: run both commands across a mixed evaluation set of notes with already-established dispositions (known keepers, known duplicates/retirements, and borderline notes from hygiene audits). Record per-note cost, duplicate recall against known successors, and false-positive retirement rate on known keepers.
- To promote either check into
commonplace-revise --full(a separate later decision): require evidence that (a) false-positive retirement or merge stops stay low enough not to stall routine--fullruns on notes the operator already intends to keep, and (b) running the check on ordinary--fulltargets catches enough genuine retirements or unlinked duplicates to justify its added latency and token cost over invoking it externally during periodic hygiene sweeps. If the yield concentrates in old-note sweeps rather than routine single-note revisions, keep the commands standalone permanently.
Relevant Notes:
- Review architecture — part-of: defines
criteria.SUPPLIEDoperational-input reports and the read-onlycommonplace-reviewboundary these trial commands reuse - Report a note's role in the KB — compares-with: covers inbound-linking dependents and link-local duplication, leaving KB-wide retention value and unlinked neighbors outside its inputs
- Choosing what to learn requires both validity and learning-value gates — rests-on: validity alone does not justify retention and maintenance cost when a note serves no surviving decision
- Cheap adoption and weak retirement accumulate cost — rests-on: motivates making retirement and duplicate detection operative rather than relying solely on ad hoc manual sweeps
- Periodic KB hygiene should be externally triggered, not embedded in routing — rests-on: motivates trialing hygiene checks as standalone triggered commands before considering whether to embed them in routine revision
- How do we value notes? — see-also: the standing question whose retention criteria the retention trial exercises
- Current task fit alone does not warrant costly entrenchment — rests-on: justifies starting with a cheap, reversible standalone trial rather than entrenching both checks inside
--fullup front