Repository navigation
Description
Summary
An award points at its opportunity through AwardBase.opportunity?: OppRef, but nothing points the other way. A consumer viewing an opportunity cannot see what it produced without searching awards by opportunityId. Billy's v0.5 candidate list adds an awards property to OpportunityDetails, the detail-only shape that already carries competitions?: CompetitionBase[].
Add optional awards?: <selected element>[] to OpportunityDetails in Core v0.5. The element shape is an explicit decision owned by this ticket: compare AwdRef[] with AwardBase[] before implementation and record the consumer rationale. The decision must address payload size, duplication, canonical-source expectations, and what a consumer may assume about dereferencing a reference when award routes are optional.
Moved from v0.6 to v0.5 in milestone planning on Sept 22, since it touches the same opportunity model as the other v0.5 opportunity changes.
Acceptance criteria
- Before implementation,
AwdRef[]andAwardBase[]are compared and the selected type plus consumer rationale is recorded, covering payload size, duplication, canonical source, thecompetitionsprecedent, and optional-route dereferencing expectations - Optional
OpportunityDetails.awards?: <selected element>[]exists with@Versioning.added(v0_5), and opportunity model documentation describes its guarantees - Version tests prove the field is absent from earlier Core artifacts and present only in v0.5 artifacts
- Website opportunity-detail fixtures include related awards; every entry resolves to a real award fixture whose
opportunity.idpoints back, and copied reference/base fields match the canonical award fixture - 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)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(core): add awards to OpportunityDetails [#1221-T1]
docs(website): document awards on the opportunity and award models [#…
feat(website): serve related awards from the opportunity mock at v0.5 […
karinamzalez commentedon Oct 7, 2026
Element shape for
OpportunityDetails.awards:AwdRef[](#1221-T1)Recorded per the first acceptance criterion. The candidates were
AwdRef[](id, title, identifiers) andAwardBase[](the full award record). The decision isAwdRef[].Payload size
AwardBaserequiresdescriptionandstatusand carries funding, key dates, funders, recipient organizations, aparentreference, system metadata, and anopportunity: OppRefthat would point back at the very record embedding it. An opportunity detail payload would grow with its award count, and every entry would repeat the opportunity's own reference.AwdRefis three fields, one of them optional.Duplication and canonical source
The award routes own the award record. Embedding
AwardBasecreates a second copy of every award under its opportunity, which can drift from the canonical record and would need a rule for which copy wins. A reference has nothing to drift: it names the canonical record and leaves the data there.The
competitionsprecedentOpportunityDetails.competitionsembeds the fullCompetitionBaseonly because no competition reference model exists. In practice the mock cannot populate nested competitions without violating the requiredformsfield, and the conformance suite carries a pinned deviation admitting it (website/__tests__/lib/mock/conformance/fixtures-vs-schemas.spec.ts, "the nested-competitions deviation (pinned, not fixed)").AwdRefentries validate cleanly, soawardsdoes not repeat that outcome.Every other cross-record pointer in Core is a reference:
AwardBase.opportunityis anOppRef,AwardBase.parentis anAwdRef, and funders and recipients areOrgRefcollections.awardsfollows that pattern rather than the one exception.Dereferencing when award routes are optional
A reference never promises that a route exists, and #1222 makes the award routes optional. The field's doc comment states the guarantee directly:
GET /awards/{id}is the canonical record only where an implementation serves the award routes, and otherwiseidentifiers(for example the FAIN) is the key for joining the award in another system. A consumer must not assume a reference can be dereferenced through this API. This is the one real advantageAwardBase[]would have offered, andidentifierscovers it without the cost above.The doc comment also fixes the field states: absent means the implementation does not publish this link for the record, and an empty array means the link is published and no awards are known. Entries carry no ordering guarantee. ADR 0024's
nullsemantics are deliberately not claimed, because the field isAwdRef[]and the emitted schema rejectsnull; onlyapplication.tsphas migrated to nullable so far, and doing it here would be an unscoped partial migration.Reversibility
If a later version wants summary fields inline (status, awarded amount), an
AwdPreview extends AwdRefcan replace the element type additively. Starting fromAwardBase[]could not be narrowed later without a breaking change.karinamzalez commentedon Oct 7, 2026
Validation pass findings: Zod and Pydantic drafts (#1221-T4)
Recorded per the fifth acceptance criterion. The pass ran on the scratch branch
karina/1221-sdk-validation-pass(7444030), which is not merged and is not an ancestor of the #1255 branch. Nothing it adds is exported from a public index, so neither published package is affected.Conclusion: the Core field needs no change before merge.
OpportunityDetails.awardsfuzzes clean at 25 of 25 generated samples, andawardstypes cleanly whilecompetitionsstays loose, which answers the ticket's ordering question: typingcompetitionsis not a prerequisite for shippingawards.The trap worth carrying into the v0.9 SDK work
The intuitive hand-written identifier model requires
registryandregistry.code, butIdentifierTdeclares both optional (lib/core/lib/core/fields/identifier.tsp:28-34). An SDK written the intuitive way therefore rejects payloads the protocol accepts. It showed up as 14 of 25 generated samples forAwdIds. The draft was loosened to match the protocol, and the cases that reproduced it are kept as regression controls inlib/ts-sdk/__tests__/schemas/zod/awards.spec.ts.Other findings
AwdRef.idcarries@visibility(Lifecycle.Read), which the JSON Schema emitter drops, so a schema-generated SDK cannot separate read and write shapes for it.unevaluatedPropertiessealing, becauseCommonGrantsBaseModeldefaults toextra="ignore". Theawd:us:fainkey also needs an explicit alias that the camelCase generator cannot produce.OpportunityBasestill lacksidentifiersandfunders(the v0.5 fields from [Core] Addidentifiersto the opportunity model andOppRef#1219 and [Core] Addfundersto the opportunity model and deprecate theagencycustom field #1220), so the drafted PythonOpportunityDetailssits on an incomplete base.awards: null/competitions: nulland nested identifier positions are logged under [Core] Resolve opportunity API nullability mismatches between SDKs and protocol #1192.Coverage caveat
The Zod half was executed. The Pydantic half is drafted but unexecuted: the machine has Python 3.9.6 and the package requires 3.11, the same wall #1220-T5 hit. Static review established the sealing finding above. The plan's T4 criterion allowed this explicitly, provided the half is flagged as unexecuted with the reason. The
datamodel-codegencomparison is likewise not performed, under the same allowance.Files on the scratch branch
lib/ts-sdk/src/schemas/zod/awards.tslib/ts-sdk/__tests__/schemas/zod/awards.spec.tslib/python-sdk/common_grants_sdk/schemas/pydantic/models/awd_ref.pyfeat(core): add awards to OpportunityDetails [#1221-T1]
docs(website): document awards on the opportunity and award models [#…
feat(website): serve related awards from the opportunity mock at v0.5 […
test(website): pin awards in the OpenAPI artifacts and cover the empt…
refactor(website): declare each award reference once [#1221-T3]
feat(core): add awards to OpportunityDetails (#1255)