Commit e203c2b
feat(shapes): capture every API-exposed field/expand + reverse-coverage gate
The conformance check only validated one direction — that the SDK's shape
constants reference *allowed* fields. Nothing checked the reverse, so the
hand-maintained explicit_schemas.py had silently fallen 200+ fields behind the
API: 209 leaf fields, 41 nested expand branches, and 3 resources (naics, psc,
mas_sins) the typed shape API couldn't request at all.
Close all of them with a generated overlay (tango/shapes/generated_overlay.py,
merged over the base by SchemaRegistry), with types resolved from live-API
sampling rather than guessed. Code-object expands (set_aside, award_type,
idv_type, …) — previously modeled inconsistently as str / bare dict — now
uniformly resolve to {code, description} via the shared CodeDescription schema.
Add a reverse-coverage gate (scripts/check_shape_coverage.py) that fails when
Tango's shape trees expose anything the SDK misses and it isn't baselined.
Offline against the vendored contract — no token, runs on forks — and wired
into the lint.yml conformance job. Regenerate the overlay with
scripts/generate_shape_overlay.py (from the vendored contract +
contracts/observed_shape_types.json, no API key); refresh the observations with
scripts/probe_shape_types.py (maintainer-run, needs a key).
Verified: 428 tests pass, mypy clean, ruff clean, conformance passes, coverage
gate at 0, and previously-uncapturable shapes now validate end-to-end while bad
fields are still rejected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent dc9a2d3 commit e203c2b
10 files changed
Lines changed: 9878 additions & 0 deletions
File tree
- .github/workflows
- contracts
- scripts
- tango/shapes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
11 | 36 | | |
12 | 37 | | |
13 | 38 | | |
| |||
0 commit comments