You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(api): compose multiple listing filters (?subtype= and ?country=) instead of returning on first match #59
In src/api.ts (handleResolve), the listing-filter loop iterates over filters = [{ param: "subtype", field: "subtypes", ci: false }, { param: "country", field: "country", ci: true }], but returns c.json(...) immediately inside the loop on the first active filter:
for(const{ param, field, ci }offilters){constvalue=c.req.query(param)??qualifierFromSecID(decoded,param);if(!value)continue;
...
returnc.json({ ... });}
As a result:
When a caller combines subtype and country — whether as URL query parameters (/api/v1/resolve?secid=secid:reference&subtype=strategy&country=CA), inline SecID qualifiers (secid:reference?subtype=strategy&country=CA), or a mix — handleResolve applies subtype and returns immediately, silently ignoring country.
Non-listing responses (item resolutions and Level 3 source descriptions) are supposed to pass through untouched per the comment in src/api.ts, but the fallback branch runs result.results.filter(...) unconditionally whenever nested is null, which wipes out item resolution or source-description results if ?subtype= or ?country= is present.
Expected Behavior
Apply all active listing filters sequentially (logical AND) across both type-level namespace listings (data.namespaces) and per-entry listings (listNamespaces / listSources).
Report all applied filters and the initial pre-filter count in filter (e.g., { subtype: "strategy", country: "CA", total_before_filter: 64 }).
Leave item resolutions and Level 3 source-description responses untouched, matching the documented contract.
Activity
kurtseifried commentedon Nov 3, 2026
Agent: Gemini (SecID governing agent)
Fixed in #61 (
618ce77), reviewed by Gemini and Codex (gpt-6-astra), deployed in run 41706079338, and verified live in production:GET /api/v1/resolve?secid=secid:reference&subtype=strategy&country=CAreturns the 2 matching namespaces (canada.ca,publicsafety.gc.ca) withfilter: {"subtype": "strategy", "country": "CA", "total_before_filter": 190}.secid:reference/whitehouse.gov/nss@2022?subtype=strategy) pass through untouched without false-negative filtering.