k-skill/docs
Jeffrey (Dongkyu) Kim 71d577b24d Polish naver-news: preflight, link canonicalization, /health docs (#143)
Address the three non-blocking items flagged in the round 1/2 reviews. All
were explicitly deferred by the reviewer as "follow-up if the maintainer
wants" — picking them up now so the feature lands with a tighter surface.

1) Preflight 400 for start + display - 1 > 1000
   Naver's official news endpoint only exposes the first 1000 items
   (start 1..1000, display 1..100). Asking for start=1000 & display=100
   would send a request that silently returns no usable items, wasting
   an upstream quota call. Reject the combination before calling upstream
   with a 400 bad_request and a message that tells the caller which item
   the request would have needed and what the cap is. Boundary values
   (start + display - 1 === 1000) are still accepted.

2) Canonical link dedup
   The previous dedup key was link.toLowerCase(), which failed to merge
   the same article when Naver's redirect URLs differed only by query-param
   order, trailing slash, host-name casing, or fragment. Added
   canonicalizeLinkForDedup() which parses the URL, sorts search params by
   key, strips a single trailing pathname slash, drops the fragment, and
   lowercases the result — conservative on purpose so different paths or
   different query values stay as distinct articles. The visible
   items[].link value is still the original URL returned by Naver; only
   the dedup key is canonicalized.

3) Clarify the naverSearchApiConfigured vs naverNewsApiConfigured split
   The two flags currently evaluate the same boolean, but their semantic
   contracts differ: naverSearchApiConfigured reports "are the Naver
   Open API keys configured" (which is advisory for the shopping route
   since shopping has a BFF fallback), while naverNewsApiConfigured
   reports "is the news route operational end-to-end" (no fallback — 503
   when false). Hoist the shared expression into a local, and add a
   `/health 업스트림 플래그 의미` section to packages/k-skill-proxy/README.md
   documenting the split. Also update naver-news-search SKILL.md and
   docs/features/naver-news-search.md to mention the new preflight and
   the canonical-link dedup behavior.

TDD verification: added 4 new node:test cases exercising the boundary,
overflow, and URL-dedup paths; ran the full k-skill-proxy workspace
suite (202/202 pass) plus the root `npm run ci` (exit 0). Manual QA on
a proxy started from this commit reproduces every round-1 case plus the
new preflight: start=1000 & display=100 → 400 bad_request before
upstream; start=1000 & display=1 and start=901 & display=100 → 503 (or
200/401 depending on keys), confirming the boundary passes preflight.
2026-04-22 13:17:51 +09:00
..
assets Prepare k-skill for packaged releases and broader skill discovery 2026-03-25 23:57:53 +09:00
features Polish naver-news: preflight, link canonicalization, /health docs (#143) 2026-04-22 13:17:51 +09:00
adding-a-skill.md NEIS 급식·학교검색 프록시, k-schoollunch-menu 스킬 및 문서 2026-04-10 13:14:15 +09:00
install.md Document korean-privacy-terms skill across repo docs 2026-04-20 12:06:57 +09:00
releasing.md Align Changesets release flow with generated package changelogs 2026-03-30 22:27:07 +09:00
roadmap.md Add lh-notice-search skill and /v1/lh-notice/{search,detail} proxy routes 2026-04-22 10:58:03 +09:00
security-and-secrets.md Route MFDS drug-safety and food-safety lookups through k-skill-proxy 2026-04-14 00:07:18 +09:00
setup.md Add library book search skill 2026-04-18 21:24:04 +09:00
sources.md Add lh-notice-search skill and /v1/lh-notice/{search,detail} proxy routes 2026-04-22 10:58:03 +09:00