fix: resolve #14 (source-repo fallback) + #15 (synonyms & relevance gate) - #16
Merged
Conversation
…ate) #14 — ac-watch.mjs, ac-fts.mjs, agent-search-lite.mjs no longer silently fall back to the package source repo when cwd has no initialized project. They now mirror ac.mjs (#13): print a bilingual error and exit 1. Removes the data-pollution risk (npx cache / package install getting user entries). #15a — add business/domain synonym cluster to search.synonyms: billing <-> payments <-> charge <-> invoice <-> 결제 (bidirectional, merged with existing jwt/auth/bug pairs). #15b — add a relevance gate so weak/no-match queries stop padding unrelated entries. New search.minHitWeight (default 2) + --min-weight N CLI flag; when the best match is below threshold, search-lite returns a bilingual guidance message ('관련 결과 없음 — 상위 레벨로 확장 검색 필요 / no related results; expand to a higher level') instead of padding. Verified: node --check on all 3 tools; e2e-workflow.mjs 6/6; project-less cwd repro exits 1 with bilingual error and leaves source agent-context/ untouched.
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.
Summary
Closes #14. Closes #15.
#14 — silent source-repo fallback removed (data-pollution fix)
Three tools previously resolved a project root by falling back to the package's own source
agent-context/whencwdwas not an initialized project — polluting the package install / npx cache with user data.tools/ac-watch.mjs—resolveProjectRoot()tools/ac-fts.mjs—resolveProjectRoot()tools/agent-search-lite.mjs—resolveProjectRoot()All three now mirror the
ac.mjs(#13) pattern: whencwdhas neitheragent-context.config.jsonnoragent-context/, they print a bilingual error andprocess.exit(1)instead of touching the source repo:No
new URL('../agent-context'…)fallback remains in any tool.#15a — business/domain synonyms
agent-context.config.jsonsearch.synonymsgained a billing↔payments↔charge↔invoice↔결제 cluster (bidirectional), merged with (not replacing) the existing jwt/token, auth/authentication/인증, bug/issue/버그, race/경쟁조건, pagination/페이지네이션/cursor pairs.#15b — relevance gate (suppress weak/no-match padding)
A new
search.minHitWeightconfig key plus a--min-weight NCLI flag gates results by hit weight. Queries whose best match is below the threshold now return a bilingualguidancemessage ("관련 결과 없음 — 상위 레벨로 확장 검색 필요 / no related results; expand to a higher level") instead of padding the answer with unrelated entries.minHitWeight = 1(legacy): historical padding behavior.minHitWeight >= 2(this PR default): weak/no-match padders are suppressed.Verification
node --checkpasses onac-watch.mjs,ac-fts.mjs,agent-search-lite.mjs.node tools/e2e-workflow.mjs→ 6/6 steps passed (at both minHitWeight 1 and 2).node tools/agent-search-lite.mjs --benchmark→ identical 60% hit rate at both values; the two misses ("overall flow", "pagination") are genuine zero-match queries, not caused by the gate.agent-context/data in the source tree.git statusshows only the 4 intended files changed.🤖 Generated with opencode