Skip to content

document and test matched_by on agency-filter diagnostics - #24

Merged
vdavez merged 1 commit into
mainfrom
feat/resolved-filters-matched-by
Oct 6, 2026
Merged

vdavez merged 1 commit into
mainfrom
feat/resolved-filters-matched-by

Conversation

@makegov-mark

@makegov-mark makegov-mark Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

What

Tango API 5.9.0 adds matched_by to each entry of meta.resolved_filters.<filter name>[] that resolved, saying how the token matched:

  • key: an organization UUID.
  • code: a 3-digit CGAC or 4-digit FPDS code.
  • name: the organization's name, including a department's everyday name, a spelling variant or a rename.
  • alias: an abbreviation or the organization's own alias.
  • fuzzy: a looser text match, worth checking against the resolved name.

An entry that did not resolve has no matched_by.
The change is additive.

Why no behaviour change

PaginatedResponse.meta is a plain Record<string, unknown> passed through as the API sends it, so matched_by already reaches callers.
This PR only documents the field and pins it with a test.

Changes

  • src/types.ts: the meta TSDoc describes matched_by and its five values.
  • docs/API_REFERENCE.md: the five values and a short example that flags fuzzy matches.
  • tests/unit/client.meta-diagnostics.test.ts: one test that a response carrying matched_by round-trips through res.meta, and that unresolvedAgencyTokens and resolvedAgencies are unchanged by it.
  • CHANGELOG.md: entry under [Unreleased].

Testing

  • npm run lint
  • npm run typecheck
  • npm run build
  • npx vitest run (437 passed)

Not in this PR

  • No version bump; that belongs to the release PR.
  • No new parsed view. resolvedAgencies returns only the matched organizations, so matched_by is read from res.meta directly. A view that exposes it (for example one listing loosely matched tokens per filter) would be new public surface and is left as a follow-up decision.

🤖 Generated with Claude Code

…ostics

Tango API 5.9.0 adds `matched_by` to each resolved entry of `meta.resolved_filters`, saying how the token matched: `key`, `code`, `name`, `alias` or `fuzzy`.
`PaginatedResponse.meta` is passed through as the API sends it, so the field already reaches callers.
This documents it on the `meta` property and in the API reference, and adds a test that it round-trips and leaves the three parsed agency views unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@makegov-mark makegov-mark Bot changed the title WIP: document and test matched_by on agency-filter diagnostics document and test matched_by on agency-filter diagnostics Oct 6, 2026
@vdavez
vdavez marked this pull request as ready for review October 6, 2026 19:58
@vdavez
vdavez merged commit a9240c0 into main Oct 6, 2026
7 checks passed
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.

1 participant