Skip to content

fix(resolver,api): filter qualifiers across all search paths and support HTTP qualifier params (#3) - #30

Merged
kurtseifried merged 2 commits into
mainfrom
fix/qualifier-filtering-cross-source-and-api
Nov 3, 2026
Merged

kurtseifried merged 2 commits into
mainfrom
fix/qualifier-filtering-cross-source-and-api

Conversation

@kurtseifried

Copy link
Copy Markdown
Contributor

Agent: Gemini (SecID governing agent)

Summary

Brings SecID-Server-API into full parity with CloudSecurityAlliance/SecID-Service#56 and closes #3:

  1. Cross-source, namespace-scoped, and bare-identifier qualifier filtering: Applies _apply_qualifier_filters (?parsability=, ?content_type=, ?lang=) in namespace_scoped_search, type_scoped_search, and _search_bare_identifier, returning _qualifier_not_found or _lang_not_found_message when matches exist for the identifier but none satisfy the requested qualifiers.
  2. Exclude URL-less RegistryResult entries when parsability or content_type is requested: Tightens _apply_qualifier_filters so data-only child items without a URL are excluded when format qualifiers are specified.
  3. Parser head qualifier stripping: Strips source-level ?qualifiers from head before splitting on / in extract_secid_type and parse_secid, preventing MIME-type slashes (e.g. secid:advisory?content_type=application/json) from being treated as path separators.
  4. Top-level HTTP query parameters on GET /api/v1/resolve: Accepts parsability, content_type, and lang query parameters and merges them structurally with inline SecID qualifiers (inline qualifiers take precedence).
  5. Regression tests: Added unit/HTTP tests in python/test_smoke.py and real-registry parity tests in python/test_real_registry.py.

Closes #3

…ort HTTP qualifier params (#3)

- Apply _apply_qualifier_filters (?parsability=, ?content_type=, ?lang=) in
  namespace_scoped_search, type_scoped_search, and _search_bare_identifier
  to match CloudSecurityAlliance/SecID-Service#56.
- Exclude URL-less RegistryResult entries when parsability or content_type
  qualifiers are requested.
- Strip source-level ?qualifiers from head before splitting on '/' in
  extract_secid_type and parse_secid so MIME slashes do not split head.
- Accept top-level parsability, content_type, and lang query parameters on
  GET /api/v1/resolve and merge them structurally with inline qualifiers.

Closes #3

AI-Agent: Gemini
…ostics (#3)

- Preserve declared weight in _child_hit (do not add +1 default-lang bonus
  during cross-source and bare searches).
- Use node_matches(..., scoped=scoped) and skip version_required sources in
  _lang_not_found_message callers so open patterns without known_values do
  not suppress the related fallback.
- Check availability of all active qualifiers in _qualifier_not_found before
  blaming lang on combined qualifier misses.

AI-Agent: Gemini
@kurtseifried

Copy link
Copy Markdown
Contributor Author

Agent: Gemini (SecID governing agent)

Two-Review Summary

  1. First review (Author — Gemini): Verified qualifier filtering across namespace_scoped_search, type_scoped_search, and _search_bare_identifier, exclusion of URL-less RegistryResult items when parsability or content_type is specified, head qualifier stripping before splitting on / in parse_secid/extract_secid_type, and top-level parsability/content_type/lang query parameter handling on GET /api/v1/resolve.
  2. Second review (Independent fresh-context — OpenAI Codex gpt-6-astra, session 01a1a1c2-63f8-7712-a521-e2faa37aa4ca):
    • [P2] Cross-source searches added +1 default-lang weight in _child_hit: Fixed by keeping the +1 default-language weight bonus in match_children_and_resolve only, matching SecID-Service.
    • [P2] _lang_not_found_message ignored node_matches scope and version_required: Fixed by passing scoped=False and skipping version_required nodes in resolve_with_name and type_scoped_search, and using node_matches(child, subpath, scoped) inside _lang_not_found_message.
    • [P3] _qualifier_not_found unconditionally blamed lang on multi-qualifier misses: Fixed by checking if not multi or qualifiers["lang"] not in available: before appending the lang diagnostic.
    • Added regression assertions in python/test_smoke.py; all 213 tests pass across lazy and bulk load modes.

@kurtseifried
kurtseifried merged commit f6919bf into main Nov 3, 2026
8 checks passed
@kurtseifried
kurtseifried deleted the fix/qualifier-filtering-cross-source-and-api branch November 3, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surface format metadata in /api/v1/resolve responses

1 participant