fix(freehire-search): say what --region is, and warn when it matches a thin bucket (#651)

* fix(freehire-search): warn when --region gets a value outside the vocabulary

freehire's contract - the openapi Regions enum and RegionValues in vocab.go -
defines a closed set: nine buckets plus none. Anything else is a stray tag, so a
region filter on us or any other country code matches a handful of postings and
reads as an empty or thin market, which is how #616 started.

search now checks the requested values (--region and the --facet regions= escape
hatch, case-insensitively) against that set and, when one falls outside it, writes
one JSON line on stderr after the results, with code REGION_VALUE_UNKNOWN. The
result count is deliberately not consulted: a broad query returns real hits under a
stray tag and the parameter is still wrong. stdout stays clean JSON, exit code 0.

Tests are unit-level with a stubbed fetch: no extra request to the free API, and no
change to the existing search tests.

* changelog: place the #651 entry under [Unreleased]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-19 19:26:58 +02:00
1 parent ebb78df069
commit f24bf85172
5 files changed
+250

No files matched your search

+9
View File
@@ -54,6 +54,15 @@ per-file diff commands.
`north_america`, `latam`, `apac`, `mena`, `africa`, `cis`) plus `none`, note that `eu` excludes
the UK, and point single-country searches at `--country`.
- **`freehire-search search` warns when `--region` gets a value outside freehire's vocabulary**
(#651, fixes #616, `.agents/skills/freehire-search/cli/src/commands/search.ts`, `SKILL.md`,
`cli/README.md`) - an unknown region such as `us` or `europe` matches nothing, so the search read
as "no postings" rather than "wrong parameter". `search` now checks `--region` and
`--facet regions=` against the nine buckets plus `none`, case-insensitively, and prints one
`REGION_VALUE_UNKNOWN` warning on stderr that lists the buckets and points a country at
`--country`. Results, stdout and the exit code are unchanged, so a bucket freehire adds later
still works.
## [1.7.3] - 2026-10-19
### Added