Skip to content

fix: resolve #14 (source-repo fallback) + #15 (synonyms & relevance gate) - #16

Merged
tak2-08 merged 1 commit into
mainfrom
fix/issue-14-15
Aug 27, 2026
Merged

fix: resolve #14 (source-repo fallback) + #15 (synonyms & relevance gate)#16
tak2-08 merged 1 commit into
mainfrom
fix/issue-14-15

Conversation

@tak2-08

@tak2-08 tak2-08 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

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/ when cwd was not an initialized project — polluting the package install / npx cache with user data.

  • tools/ac-watch.mjsresolveProjectRoot()
  • tools/ac-fts.mjsresolveProjectRoot()
  • tools/agent-search-lite.mjsresolveProjectRoot()

All three now mirror the ac.mjs (#13) pattern: when cwd has neither agent-context.config.json nor agent-context/, they print a bilingual error and process.exit(1) instead of touching the source repo:

agent-context가 초기화되지 않았습니다. 먼저 'agent-context-init.mjs --yes' 를 실행하세요.
(agent-context not initialized in cwd; run 'agent-context-init.mjs --yes' first.)
cwd: <cwd>

No new URL('../agent-context'…) fallback remains in any tool.

#15a — business/domain synonyms

agent-context.config.json search.synonyms gained 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.minHitWeight config key plus a --min-weight N CLI flag gates results by hit weight. Queries whose best match is below the threshold now return a bilingual guidance message ("관련 결과 없음 — 상위 레벨로 확장 검색 필요 / 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 --check passes on ac-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.
  • Pollution repro from an uninitialized dir: all three tools exit 1 with the bilingual error and create no agent-context/ data in the source tree.
  • git status shows only the 4 intended files changed.

🤖 Generated with opencode

…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.
@tak2-08
tak2-08 merged commit 84aec2d into main Aug 27, 2026
1 check 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

1 participant