Repository navigation
feat(recall): measurable paraphrase corpus, softer precision floor, SE synonyms - #168
Merged
Merged
Conversation
…E synonyms Tier 3 of the field-test backlog. A field test measured HIT@1 falling from 65% to 41% on a fixed query set purely as the store grew 20 -> 30 notes. Nothing would have caught that: recall_precision_test.go uses 2-3 note corpora, where the failure modes that matter can't appear. So the first change is the measurement, not a scoring tweak. The new corpus is 12 notes (8 targets plus plausible distractors, including a glossary note — a known universal attractor because it enumerates everyone else's vocabulary) and 8 queries that share NO verbatim content word with their target, with a HIT@1 floor asserted. It found a real defect immediately, and it is the thing that makes the deferred length-normalization work evaluable rather than a guess. **The precision floor was a cliff in both directions.** Requiring >=2 matched concepts for any query of >=4 words is right when something clears it, but as an unconditional filter it returned NOTHING for a heavily paraphrased query that shares one concept with its target — while the same intent in three words returned the right note. Three of the eight corpus queries failed exactly that way. The floor now applies only when at least one candidate clears it; otherwise one shared concept is all the signal the query carries, and a ranked list beats an empty answer (the score already shows how weak the match is). HIT@1 on the corpus: 5/8 -> 8/8. Every existing guarantee still holds — TestRankPrecisionFloor, TestRankDropsNoise and TestRankNoCrossDomainBleed all pass unchanged. **`gc` left the memory-leak synonym group.** `nt gc` is store cleanup, so "what does gc do" surfaced a heap-allocation note above the gc reference. It belongs in the list of ambiguous cross-domain tokens this file already deliberately refuses to group (column, index, origin, lock, database). **Eight software-engineering groups added.** The table was generic web-SaaS vocabulary (billing, i18n, cors) for a tool whose users are mostly writing code; 48 natural paraphrase pairs from a Go codebase linked only 3. Added undo/revert/rollback, lint/vet/staticcheck, duplicate/clobber/overwrite, regex/matcher, serialize/marshal/encode, dependency/bump/upgrade, ci/pipeline, frontmatter/yaml/toml — narrow and non-overlapping per this file's own rule. flag/option and module/package are deliberately absent: a feature flag and a CLI flag are not the same thing. **SKILL.md's recovery advice was backwards.** It said an empty result means nothing is recorded, "don't retry with looser words". The corpus shows the right move for a long, specific query is one SHORTER retry — a wordy question dilutes the two or three concepts carrying the meaning. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FgqQf7Lvou5F5as9aNmagu
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.
Tier 3 of the field-test backlog — the ranking work.
The measurement comes first
A field test measured HIT@1 falling from 65% → 41% on a fixed query set purely as the store grew 20 → 30 notes. Nothing would have caught that:
recall_precision_test.gouses 2–3 note corpora, where the failure modes that matter can't appear — a long note winning on coincidental overlap, or a glossary note acting as a universal attractor.So the first change here is the measurement, not a scoring tweak:
minHitAtOnefloor, with a comment saying to raise it on a genuine improvement and never lower it to make a change passIt found a real defect immediately. It's also what makes the deferred length-normalization work evaluable instead of a guess — I deliberately did not attempt that here, because without this corpus there was no way to tell whether it helped or hurt.
The precision floor was a cliff in both directions
Requiring ≥2 matched concepts for any query of ≥4 words is right when something clears it. As an unconditional filter it returned nothing for a heavily paraphrased query sharing one concept with its target — while the same intent in three words returned the right note. Three of the eight corpus queries failed exactly that way, returning
(nothing).The floor now applies only when at least one candidate clears it. Otherwise one shared concept is all the signal the query carries, and a ranked list beats an empty answer — the score already tells the caller how weak the match is.
HIT@1: 5/8 → 8/8.
Every existing guarantee still holds —
TestRankPrecisionFloor,TestRankDropsNoiseandTestRankNoCrossDomainBleedpass unchanged.gcleft the memory-leak groupnt gcis store cleanup, so "what does gc do" surfaced a heap-allocation note above thent gcreference. It belongs in the list of ambiguous cross-domain tokens this file already deliberately refuses to group (column, index, origin, lock, database) — so this follows the existing rule rather than inventing one.Eight software-engineering groups added
The table was generic web-SaaS vocabulary (billing, i18n, cors, stripe) for a tool whose users are mostly writing code. A field test of 48 natural paraphrase pairs from a Go codebase linked 3.
Added:
undo/revert/rollback,lint/vet/staticcheck,duplicate/clobber/overwrite,regex/matcher,serialize/marshal/encode,dependency/bump/upgrade,ci/pipeline,frontmatter/yaml/toml.Narrow and non-overlapping per this file's own rule.
flag/optionandmodule/packageare deliberately absent — a feature flag and a CLI flag are not the same thing.SKILL.md's recovery advice was backwards
It said an empty result means nothing is recorded, "don't retry with looser words." The corpus shows the right move for a long, specific query is one shorter retry — a wordy question dilutes the two or three concepts carrying the meaning. Reworded to say shorter, not looser.
Verification
go build,go vet ./...,go test ./...,golangci-lint run(0 issues) all clean.Generated by Claude Code