mirror of
https://github.com/NomaDamas/k-skill.git
synced 2026-06-24 02:04:11 +00:00
Live data revealed two unmet contracts in the kstartup-search helper:
1. SKILL.md L121 promised the helper re-applies supt_regin / aply_trgt /
biz_enyy filters on the client side because K-Startup upstream ignores
them server-side. The helper had no such logic — calling
`--supt-regin 서울특별시 --rcrt-prgs-yn Y` returned 경북/충북/충남
announcements as-is, silently misleading callers.
2. The upstream `supt_regin` field is stored as the short form
(`서울`, `경기`, `충북`, ...) but every CLI example in the skill used
the standard 광역지자체 long form (`서울특별시`), which would never
substring-match even after a client filter was added.
Add `apply_client_filters()` that runs after `urlopen` returns. It honors
the SKILL.md contract literally: substring match per token, AND-joined
across comma-separated user values, with a 17-region (+`전국`) shortname
normalisation table so both `--supt-regin 서울특별시` and
`--supt-regin 서울` resolve to upstream's `서울`. Filtered responses
expose a new `client_filter: {fields, upstream_returned, after_filter}`
metadata block so callers can detect "first page was depleted by filter"
and page through.
Tests: 9 new ClientFilterTests + 2 normalisation tests on top of the
existing 14 (25 total, all passing).
Live smoke (against a dev proxy with DATA_GO_KR_API_KEY activated for
dataset 15125364): `--supt-regin 서울특별시 --rcrt-prgs-yn Y --per-page 10`
now returns 4 actual 서울 announcements (upstream returned 10 mixed-region
rows; client filter narrowed to 4), with detl_pg_url to k-startup.go.kr.
Confidence: high. Scope-risk: narrow — purely additive on the response
path; other endpoints (business-info / contents / statistics) pass
through unchanged.
|
||
|---|---|---|
| .. | ||
| run_kstartup.py | ||