Skip to content

Commit 3f683ce

Browse files
vdavezclaude
andcommitted
feat(shapes): cover relationships(type, source) on entities
Tango API 4.20.0 adds two keys to each entry in the entity `relationships` expand — `type` (the stable relationship-type code) and `source` (where the tie came from) — and both are shape-selectable. The SDK's vendored contract predated them, so the shape overlay described the expand as `display_name` / `relation` / `uei` only. Re-vendored the contract and regenerated `tango/shapes/generated_overlay.py`. The only schema delta is the two new leaves on `RELATIONSHIPS_SCHEMA`; the generator produced no other changes across the other 30 containers. Also records the upstream `relation` vocabulary change in the changelog. That needs no SDK code change — `relation` was and remains a `str` — but application code branching on the string `affiliate` should move to `type`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 1fc111d commit 3f683ce

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- **`relationships(type, source)` on entities.** Tango API 4.20.0 added two keys to each entry in the entity `relationships` expand: `type`, the stable relationship-type code (`prime_sub`, `parent_subsidiary`, `ultimate_parent`, `predecessor`), and `source`, where the tie came from (`sam`, `subawards`). Both are shape-selectable, so `shape="uei,relationships(type,source,uei)"` now resolves against the SDK's schema. Re-vendored the contract and regenerated the shape overlay; the coverage gate reports 0 gaps.
12+
13+
### Changed
14+
- **The `relation` value vocabulary changed upstream — match on `type` instead.** In Tango API 4.20.0 the `relation` label stopped collapsing to `affiliate` for subcontracting and corporate-succession ties and now names the partner's role: `subcontractor` / `prime`, `predecessor` / `successor`, and `descendant` (rather than `child`) on the far side of an ultimate-parent tie. `affiliate` survives only as a fallback for a type the API doesn't recognize. This affects the large majority of relationship entries.
15+
16+
No SDK code change is required — `relation` was and remains a `str`. But if you have application code branching on the string `affiliate`, switch it to `type`, which is stable and won't churn again. See the [entities data dictionary](https://docs.makegov.com/data-dictionary/entities/#relationships) for the full vocabulary table.
17+
1018
## [1.4.0] - 2026-07-20
1119

1220
### Added

contracts/filter_shape_contract.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"meta": {
3+
"api_version": "4.20.0",
34
"description": "Canonical API filter/shape contract. Downstream consumers (SDK, MCP) should validate their conformance against this manifest.",
45
"generated_from": "scripts/filter_shape_conformance.py",
56
"schema_version": 2
@@ -2511,6 +2512,8 @@
25112512
"fields": [
25122513
"display_name",
25132514
"relation",
2515+
"source",
2516+
"type",
25142517
"uei"
25152518
]
25162519
},
@@ -2685,6 +2688,8 @@
26852688
"relationships",
26862689
"relationships.display_name",
26872690
"relationships.relation",
2691+
"relationships.source",
2692+
"relationships.type",
26882693
"relationships.uei",
26892694
"sam_activation_date",
26902695
"sam_expiration_date",

tango/shapes/generated_overlay.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,8 @@
716716
RELATIONSHIPS_SCHEMA: dict[str, FieldSchema] = {
717717
"display_name": FieldSchema(name="display_name", type=str, is_optional=True, is_list=False),
718718
"relation": FieldSchema(name="relation", type=str, is_optional=True, is_list=False),
719+
"source": FieldSchema(name="source", type=str, is_optional=True, is_list=False),
720+
"type": FieldSchema(name="type", type=str, is_optional=True, is_list=False),
719721
"uei": FieldSchema(name="uei", type=str, is_optional=True, is_list=False),
720722
}
721723

0 commit comments

Comments
 (0)