Skip to content

feat: Tango API 5.9.0 contract, Federal Register documents, attachment file and link counts - #25

Draft
makegov-mark[bot] wants to merge 1 commit into
mainfrom
chore/contract-5.9.0
Draft

makegov-mark[bot] wants to merge 1 commit into
mainfrom
chore/contract-5.9.0

Conversation

@makegov-mark

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

Copy link
Copy Markdown
Contributor

What

Brings the SDK from the Tango API 5.1.0 contract to Tango API 5.9.0 and closes every gap the two conformance gates report against it.

  • Attachment file and link counts (Tango API 5.9.0). Opportunities accept meta(files_count,links_count) beside meta(attachments_count); notices accept file_count and link_count beside attachment_count. Opportunity gains a typed meta (OpportunityMeta) and Notice gains the three counts.
  • Federal Register documents (Tango API 5.3.0). listFederalRegisterDocuments(options) and getFederalRegisterDocument(uuid, options), all seventeen filters typed, a FederalRegisterDocument model, a shape schema, and FEDERAL_REGISTER_MINIMAL / FEDERAL_REGISTER_COMPREHENSIVE. This mirrors tango-python's list_federal_register_documents() / get_federal_register_document().
  • Typed filters on resources the SDK already wraps. awarded and awardee_uei on opportunities (5.5.0); agency on budget accounts, exclusions and IT Dashboard (5.3.0); cycle_name on SBIR topics (5.3.1); account_category, account_category__in and the four data_through_period filters on budget accounts (5.7.0, 5.8.0). Dunder names are sent verbatim.
  • Shapes accept the fields added through 5.9.0: award leaves and the awards(...) expand on opportunities and notices, the organization(...) expand on budget accounts, exclusions and SBIR, account_category / data_through_period / source_anomalies on budget accounts, and holder_count / order_winner_count on vehicles.

What a caller needs to know about the counts

An attachment's type is file (a document; only a file has extracted text) or link (a URL the notice lists).
The new fields count each, and the existing total still counts every attachment, links included.
An attachment of any other type counts only in the total, so files plus links need not equal it.
The new fields are null until a record has been counted, so read null as unknown, not zero.
The SDK's default shapes are unchanged, so the counts have to be named in shape.

Generated versus hand-written

  • Vendored, byte-identical to the API's published 5.9.0 contract: contracts/filter_shape_contract.json (51 resources, up from 50; federal_register is the new one).
  • Vendored from tango-python: contracts/observed_shape_types.json. Without it the generator guesses types from field names and gets awards (a list), awarded (a boolean) and data_through_period (an integer) wrong.
  • Generated by npm run generate-shape-overlay: src/shapes/generatedOverlay.ts (385 fields across 28 containers, 76 nested schemas).
  • Hand-written: everything else, including the FederalRegisterDocument explicit schema, which follows tango-python's field for field.

Gates and tests

  • npm run check-conformance: 0 errors. The 13 warnings are the same ones main reports (nested sub-resource routes that take filters through an index signature, and the baselined ebuy/requests, events, news).
  • npm run check-shape-coverage: 15 gaps, 15 baselined, 0 new.
  • Neither baseline file changes. Federal Register is wrapped rather than baselined, so eBuy requests remain the only contract resource without a method.
  • npm run generate-shape-overlay reproduces the committed overlay with no diff.
  • npx vitest run: 50 files, 475 tests pass. npm run lint, npm run typecheck and npm run build are clean.
  • New tests are offline unit tests, the same way the SLED and contract-appeals resources were tested. No cassettes were recorded or refreshed, so nothing here has been run against the live API.
  • The new shape tests fail against the previous overlay (9 of 15 in client.shape-parity.test.ts), which is the check that they exercise the change.

Overlap with open drafts

#22 and #23 each re-vendor the contract to 5.8.0, regenerate the overlay and baseline federal_register.
This PR supersedes those three pieces, so both will conflict in contracts/, src/shapes/generatedOverlay.ts and the changelog once this lands, and their federal_register baseline entries should be dropped on rebase.
Their hand-written work is deliberately left to them: the BudgetAccount anomaly types and budget docs (#22), and the vehicle model fields, default-shape change and awardee_count deprecation (#23).
The seven budget filter options added here are the same lines #22 adds.
#21 (eBuy) is untouched; it removes the last baselined resource.

Release

No version bump here.
CHANGELOG.md is updated under [Unreleased].
The additions are backward compatible, so the next release is a minor.

🤖 Generated with Claude Code

…t file and link counts

Re-vendors the API contract from 5.1.0 to Tango API 5.9.0 and regenerates the shape overlay, so shapes accept every field the API added in between.
Opportunities accept `meta(files_count,links_count)` and notices accept `file_count` and `link_count`, both new in 5.9.0; the types and docs say what they count and that null means not yet counted, not zero.
Adds `listFederalRegisterDocuments` and `getFederalRegisterDocument` with all seventeen filters typed, a `FederalRegisterDocument` model, a shape schema and two default shapes, matching tango-python.
Types the filters the API added on resources the SDK already wraps: `awarded` and `awardee_uei` on opportunities, `agency` on budget accounts, exclusions and IT Dashboard, `cycle_name` on SBIR topics, and the account category and `data_through_period` filters on budget accounts.
Re-vendors the observed shape types from tango-python so the new fields carry the types the API returns.
Both conformance gates pass against the new contract with no baseline growth; eBuy requests remain the one baselined resource without a method.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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