Skip to content

fix(resolver,api): compose listing filters and populate source subtypes (#59, #60) - #61

Merged
kurtseifried merged 2 commits into
mainfrom
fix/listing-filters-and-source-subtypes
Nov 3, 2026
Merged

kurtseifried merged 2 commits into
mainfrom
fix/listing-filters-and-source-subtypes

Conversation

@kurtseifried

Copy link
Copy Markdown
Contributor

Agent: Gemini (SecID governing agent)

Summary

Fixes #59
Fixes #60

  1. Compose active listing filters (#59):

    • In src/api.ts (handleResolve), collect all active listing filters (subtype, country) and apply them via logical AND instead of returning on the first matched filter.
    • Report all applied filters and total_before_filter in body.filter.
    • Guard the per-entry listing branch so item resolutions and Level 3 source descriptions pass through untouched, matching the documented contract.
  2. Populate subtypes and country on namespace source listings and support namespace/* wildcard (#60):

    • In src/resolver.ts (listSources), include sorted subtypes: string[] (from node.data.subtype) and optional country: string[] (from ns.tags?.country) on each source entry's data, matching listNamespaces.
    • Treat parsed.name === "*" under a resolved namespace as a namespace source listing (listSources), matching type-level /* wildcard behavior.
    • Report No sources with ... found in this namespace. when a namespace source listing filter matches 0 sources.

Verification

  • npm test: 17 test files passed (929 tests, including 5 new tests in test/country-filter.test.ts and test/api.test.ts).

…es (#59, #60)

- Compose active listing filters (subtype, country) sequentially via
  logical AND in handleResolve instead of returning on the first match,
  and report all applied filters in body.filter.
- Leave item resolutions and Level 3 source descriptions untouched when
  listing filter params are present.
- Populate subtypes (and optional country) on namespace source listings
  in listSources() and support namespace/* wildcard queries.

Fixes #59
Fixes #60

AI-Agent: Gemini
Addresses Codex review finding (P3): check result.status === "found"
rather than result.results.length > 0 so valid namespace listings with
zero match_nodes still report filter metadata (total_before_filter: 0).

AI-Agent: Gemini
@kurtseifried

Copy link
Copy Markdown
Contributor Author

Agent: Gemini (SecID governing agent)

Review Record

  1. Self-review (Gemini):

    • Verified handleResolve in src/api.ts composes active listing filters (subtype, country) via logical AND and leaves item resolutions and Level 3 source descriptions untouched.
    • Verified listSources() in src/resolver.ts populates subtypes and optional country on source entries and resolve() routes namespace/* wildcard queries to listSources().
    • Verified all 930 unit/integration tests pass locally and in CI.
  2. Independent cross-vendor review (Codex gpt-6-astra, session 01a1a2e9-243f-7370-92b1-d3644d860742):

    • Caught P3: checking result.results.length > 0 dropped filter metadata on valid namespace source listings with zero match_nodes (e.g., entity namespaces with match_nodes: []).
    • Addressed in d2df3fc by checking result.status === "found" instead of result.results.length > 0 and adding regression tests for empty namespace source listings in test/country-filter.test.ts and test/api.test.ts.

Merging now and watching the production deploy.

@kurtseifried
kurtseifried merged commit 618ce77 into main Nov 3, 2026
1 check passed
@kurtseifried
kurtseifried deleted the fix/listing-filters-and-source-subtypes branch November 3, 2026 19:44
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