Skip to content

Sync to Tango API v4.6.9: budget surface, singleton GETs, bug fixes (v1.1.0)#9

Merged
vdavez merged 5 commits into
mainfrom
feat/api-sync-v1.1.0
May 29, 2026
Merged

Sync to Tango API v4.6.9: budget surface, singleton GETs, bug fixes (v1.1.0)#9
vdavez merged 5 commits into
mainfrom
feat/api-sync-v1.1.0

Conversation

@makegov-mark
Copy link
Copy Markdown

@makegov-mark makegov-mark Bot commented May 28, 2026

Summary

Syncs the Node SDK to Tango API v4.6.9. The v1.0.0 parity sweep closed most of the historical gap; this closes the rest of the agreed-on surface and fixes real bugs. Version bump 1.0.0 → 1.1.0.

Paired with makegov/tango-python — both PRs keep the cross-SDK parity tests green.

⚠️ Breaking change: removes getIdvSummary and listIdvSummaryAwards (see below).

Phase 1 — Bug fixes

  • Contract interface: dropped dead fields (id, award_id, recipient_name, award_amount, awarding_agency, funding_agency) the API has never returned; added the real ContractList field set with proper nested types (OrganizationOfficePayload, PlaceOfPerformance, SubawardsSummary, LegislativeMandates, ParentAwardReference). Every field optional (shape-on-demand). Old fields kept as @deprecated → removed in 2.0.0. Contract is an exported, user-facing type, so this corrects the shape consumers code against.
  • listContracts: stopped sending page=1 to /api/contracts/, which is cursor-only (KeysetPagination) and ignores page. Also fixed a stale code comment claiming page-based pagination.
  • Removed getIdvSummary / listIdvSummaryAwards — they called /api/idvs/{id}/summary/ and /summary/awards/, which have never existed in the API. No consumer could have used them successfully. Breaking change, flagged in CHANGELOG.
  • listVehicleOrders added (parity with Python's list_vehicle_orders).

Phase 2 — Additive surfaces

  • Budget accounts (the headline new surface): listBudgetAccounts, getBudgetAccount, getBudgetAccountQuarters, getBudgetAccountRecipients + BudgetAccount interface.
  • Singleton detail GETs: getContract, getContractSubawards, getContractTransactions, getForecast, getGrant, getNotice, getOpportunity, getSubaward.
  • getEntityBudgetFlows(uei).
  • grantId filter on listGrants.

Phase 3 — CI

  • Added ci.yml PR gate: lint, typecheck, build, and test across Node 18/20/22; conformance runs as a separate non-blocking job. (Previously the repo had no PR-gating workflow.)

Deferred (by decision)

accounts/usage (internal), G2X events/news/company-rag, canonical webhook-subscriptions CRUD, PUT/PATCH webhook aliases, cage alias (already covered by cage_code).

Test plan

  • npx vitest run220 passed (23 files); conformance errors=0
  • npm run lint + npm run typecheck clean
  • Updated 3 unit tests that asserted the old page=1 behavior + removed the 2 calls to the deleted IDV-summary methods
  • X-Requests-Remaining header verification (deferred to a live smoke test)

🤖 Generated with Claude Code

~ Mark

…ixes)

BREAKING CHANGE: remove getIdvSummary and listIdvSummaryAwards — these called
/api/idvs/{id}/summary/ and /summary/awards/, which have never existed in the
API. No consumer could have used them successfully.

Phase 1 (bug fixes):
- Contract interface: drop dead fields (id, award_id, recipient_name,
  award_amount, awarding_agency, funding_agency); add real ContractList fields
  with proper nested types. All fields optional (shape-on-demand). Old fields
  kept as @deprecated, to be removed in 2.0.0.
- listContracts: stop sending page=1 to the cursor-only /api/contracts/.
- remove getIdvSummary / listIdvSummaryAwards (see breaking change above).
- add listVehicleOrders (parity with Python).

Phase 2 (additive):
- budget accounts surface: listBudgetAccounts, getBudgetAccount,
  getBudgetAccountQuarters, getBudgetAccountRecipients (+ BudgetAccount type).
- singleton detail GETs: getContract, getContractSubawards,
  getContractTransactions, getForecast, getGrant, getNotice, getOpportunity,
  getSubaward.
- getEntityBudgetFlows(uei).
- grantId filter on listGrants.

Phase 3 (CI):
- add ci.yml PR gate (lint, typecheck, build, test on Node 18/20/22;
  conformance as a non-blocking job).

Version bump to 1.1.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/ci.yml
Comment on lines +19 to +53
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: ["18", "20", "22"]

steps:
- uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
# No lockfile is committed (package-lock.json is gitignored), and the
# "prepare" script runs a build that needs tsc — so ignore scripts here
# and build explicitly below.
run: npm install --ignore-scripts --no-audit --no-fund

- name: Lint
run: npm run lint

- name: Typecheck
run: npm run typecheck

- name: Build
run: npm run build

- name: Test
# `vitest run` forces a single non-watch pass in CI.
run: npx vitest run

conformance:
Comment thread .github/workflows/ci.yml Fixed
vdavez and others added 2 commits May 28, 2026 08:17
CONTRACT_SCHEMA/IDV_SCHEMA reference the competition leaf as
"ContractOrIDVCompetition" but only "Competition" was registered in
EXPLICIT_SCHEMAS, so competition(...) nested selections on contract/IDV shapes
failed validation. Register the name as an alias of COMPETITION_SCHEMA.
Fixes tango-python#29 item 1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The new ci.yml surfaced two issues unrelated to the API sync: the conformance
job failed because the private makegov/tango checkout needs an unconfigured
TANGO_API_REPO_ACCESS_TOKEN secret, and a real-HTTP-server webhooks round-trip
test timed out at the default 5s on the slower Node 18 runner (passed on 20/22).

Gate the conformance steps on the token being present so the job skips cleanly
(green) instead of failing red, and becomes a real gate once the secret exists.
Give the round-trip test an explicit 20s timeout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/ci.yml
Comment on lines +59 to +97
runs-on: ubuntu-latest

steps:
- name: Determine token availability
id: gate
env:
TANGO_API_REPO_ACCESS_TOKEN: ${{ secrets.TANGO_API_REPO_ACCESS_TOKEN }}
run: |
if [ -n "$TANGO_API_REPO_ACCESS_TOKEN" ]; then
echo "ready=true" >> "$GITHUB_OUTPUT"
else
echo "ready=false" >> "$GITHUB_OUTPUT"
echo "::notice::Skipping SDK conformance check — TANGO_API_REPO_ACCESS_TOKEN not configured."
fi

- uses: actions/checkout@v4
if: steps.gate.outputs.ready == 'true'

- name: Checkout tango API repo (manifest source)
if: steps.gate.outputs.ready == 'true'
uses: actions/checkout@v4
with:
repository: makegov/tango
path: tango-api
token: ${{ secrets.TANGO_API_REPO_ACCESS_TOKEN }}

- name: Set up Node.js
if: steps.gate.outputs.ready == 'true'
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
if: steps.gate.outputs.ready == 'true'
run: npm install --ignore-scripts --no-audit --no-fund

- name: Check SDK filter/shape conformance
if: steps.gate.outputs.ready == 'true'
run: npx tsx scripts/check-filter-shape-conformance.ts --manifest tango-api/contracts/filter_shape_contract.json
vdavez and others added 2 commits May 28, 2026 08:49
The first round-trip test got a 20s timeout last commit; the sibling
"propagates the server's status code and body" test in the same describe block
hit the same default-5s timeout on the slow Node 18 runner. Give it the same
explicit 20s timeout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vdavez vdavez merged commit 6cff871 into main May 29, 2026
8 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.

2 participants