Documentation
¶
Overview ¶
Package wording decides whether two short rule/note pairs say the same thing. It is the deterministic restatement check behind proposal deduplication (internal/distill) and ambient pin budgeting (internal/reviews) — two importers that must reach one answer, which is why the logic lives in a leaf package neither owns.
The check is calibrated, not guessed: thresholds were tuned against a real pin file where 23% of 65 applied pins restated something already pinned — every hand-identified duplicate cluster is caught, and no distinct pin is merged (the calibration set lives in wording_test.go).
Index ¶
Constants ¶
const MaxRuleLen = 40
MaxRuleLen bounds a normalized rule label — long enough for any honest kebab slug, short enough that a label echoed into prompts and terminals can never blow a budget. Exported because prompt-budget arithmetic downstream stands on this exact bound.
Variables ¶
This section is empty.
Functions ¶
func CleanRule ¶
CleanRule normalizes a label to pin-safe kebab-case: lowercased, spaces to hyphens, everything outside [a-z0-9-] stripped, length capped. Labels are echoed back — into agent prompts and onto terminals — and pins are hand-written in committed config, which on a cloned repo is no more trusted than a review comment: unnormalized, a multiline rule would inject lines into a prompt's instruction block.
Types ¶
type Topic ¶
type Topic struct {
// contains filtered or unexported fields
}
Topic is the comparable form of one pattern: its label and guidance reduced to topic words.
func New ¶
New builds a Topic from a pattern's rule label and guidance note. The label is normalized through CleanRule; matching reads the raw text — words() lowercases and drops punctuation itself, so normalization changes nothing about which patterns restate each other.