Repository navigation
Description
Summary
OppRef carries only id and title, while OrgRef and AwdRef expose typed identifier collections. The awards reference implementation joins USASpending awards to Grants.gov opportunities on the funding opportunity number but cannot publish that number on award.opportunity; this is the v0.5 opportunity-model gap deferred from v0.4.
Add OppIdFon is IdentifierT<string, "opp:us:fon">, OppIdAln is IdentifierT<string, "opp:us:aln">, and OppIds extends IdentifierCollection. Add versioned identifiers?: OppIds to OppRef; OpportunityBase receives the property through its existing ...OppRef spread and must not redeclare it. The registry catalog already contains both codes, so this ticket checks consistency rather than creating duplicate registry entries.
The TS and Python v0.9 opportunity-alignment tickets own the official SDK OpportunityBase changes. The award-schema tickets own the shared OppRef identifier closure once because AwardBase.opportunity reaches it. Identifier lookup on GET /opportunities remains the separate, unimplemented ADR 0023 requirement.
Acceptance criteria
-
OppIdFon,OppIdAln, andOppIdsexist with@Versioning.added(v0_5), andOppRef.identifiers?: OppIdsis added once and inherited byOpportunityBase - The typed keys, embedded registry codes, links, examples, and existing catalog entries for
opp:us:fonandopp:us:alnagree - Generated v0.4 artifacts remain unchanged; v0.5 OpenAPI and JSON Schema artifacts expose the typed identifier models and inherited field
- Examples or fixtures exercise both base registry keys, and website model documentation plus the changelog describe the field
- Validation pass: before merging to the hold branch, draft the new models in Zod and Pydantic to catch design issues early (not merged, just a check)
- cg-usaspending can emit
opportunity.identifiersand validate against the v0.5 bundle withOPPORTUNITY_IDENTIFIERS=include
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
karinamzalez commentedon Oct 1, 2026
T5: Zod and Pydantic validation pass for
OppIdsScratch branch
karina/1219-sdk-validation-pass(nothing merges; the code exists so the findings are reviewable). Full write-up in1219-T5-FINDINGS.mdon that branch.Zod: the shapes express cleanly. One
identifierT(code, id)factory coversIdentifier,SystemId,OppIdFon, andOppIdAln, withIdentifierCollection,OppIds, andOppRefon top. The parity harness passes on all eight schemas with two understood divergences: the ADR 0024 nullish gap (#1192), andIdentifierCollection, which the protocol leaves open but the harness force-seals with.strict(), so no open protocol schema can currently be matched. That second one is a harness limitation worth its own issue. Colon-bearing keys andallOfflattening via.extend()both work, the latter only because the sealed collection is the sole sealing subschema.Pydantic:
datamodel-codegenloses three protocol guarantees.otherIdsvalidates and then silently discards every extension identifier:Record<Identifier>emits asunevaluatedPropertiesover emptyproperties, which the generator renders as a bare model. This is data loss and is protocol-wide for everyRecord<T>; emittingadditionalPropertiesinstead would fix it.unevaluatedProperties: {not: {}}survives only as inertjson_schema_extra. Needs anextra="forbid"decision onCommonGrantsBaseModel.constregistry.codebecomes a required field with a default, so the model invents a code the producer never sent.Colon-keyed aliases (
Field(alias="opp:us:fon")) work as-is through the camelCase alias generator, which answers the ticket's open question.Also found: T1 left
lib/ts-sdkred.OpportunityBaseSchemalacked theidentifiersfield thatOpportunityBasenow inherits, and the ts-sdk workflow is path-filtered tolib/ts-sdk/**, so the core change never ran the suite that it broke. Fixed in #1250: the field is accepted permissively with the divergence tracked against #1156, and the workflow now also triggers onlib/core/**.Python SDK gates could not be run on this machine (no Poetry, no Python 3.11+), so the Pydantic draft is unlinted.
karinamzalez commentedon Oct 1, 2026
T6: cg-usaspending validates clean against the v0.5 schemas
Ran agilesix/cg-usaspending at
2ec4e9eagainst the v0.5 bundle from2b0ac7a(website/public/schemas/yaml), using the tracked snapshots (no live API calls):Result: 84 records, 0 validation failures, 0 known-gap records at
/opportunity/identifiers. Every record carriessystemId,opp:us:fon, andopp:us:aln, so the new fields are exercised rather than absent. The same output against the vendored v0.4 bundle reports 84 known-gap records, one per record, so the schema is the only variable.Where
opp:grants.gov:systemlands: undersystemId.registry.code(src/transform/award.ts:235), not as a top-level key. A top-level key would fail (unevaluatedProperties), which I confirmed by mutating a record; wrong registry constants and unknown top-level keys are rejected too, while the same key underotherIdspasses.OPPORTUNITY_IDENTIFIERS=omitalso validates, since the field is optional.No producer-side change is needed. Once v0.5 ships, cg-usaspending can drop the
opportunityIdentifiersswitch and the/opportunity/identifiersknown-gap plumbing (src/config.ts:59-69,src/index.ts:40-62). Happy to open that issue if wanted.fix(ts-sdk): track the identifiers divergence against the opportunity…
feat(core): add identifiers to the opportunity model and OppRef (#1250)
feat(core): add funders to the opportunity model and deprecate the ag…
feat(core): add awards to OpportunityDetails (#1255)