Skip to content

fix(code-index): place DAC2a destinations by graph type - #317

Merged
jm-rivera merged 4 commits into
devfrom
fix/dac2a-destination-side-from-data
Nov 16, 2026
Merged

jm-rivera merged 4 commits into
devfrom
fix/dac2a-destination-side-from-data

Conversation

@jm-rivera

Copy link
Copy Markdown
Contributor

code_index.scope_conventions.destination_side places each DAC2a destination on the bilateral, multilateral or spanning side from the graph types the code index build already reads, so a recipient registered in Wikibase with its type needs no code edit. Each party row of the code index keeps its sorted graph types (PartyRow.types).

Changes

  • code_index/export.py writes each party's graph types, and code_index/loader.py refuses a party row without a list of strings under types.
  • graph_release.format.FORMAT moves to 3, since this image cannot read a release built without types.
  • destination_side takes the code index and classifies a party typed Country as bilateral and an official Organization as multilateral. A residual is bilateral when a bilateral total lists it (the Mekong Delta Project, a residual of Asia), otherwise multilateral when typed DACUnspecifiedParty and bilateral when typed DACRecipientUnallocatedByCountry. All recipients is spanning, all multilateral recipients and Organization-typed totals are multilateral, and every other destination total is bilateral. The residuals bilateral totals list are memoised per index.
  • multilaterals.party_facts reads the Organization type instead of the entity resolver's organisation records (organisation_dcids, removed).
  • Removed DAC_BILATERAL_GROUP_TOTALS, DAC_MULTILATERAL_RECIPIENTS, DAC_BILATERAL_UNALLOCATED, _BILATERAL_TOTALS and _BILATERAL_RESIDUALS; the release declaration pins follow. DAC_BILATERAL_ORGANISATIONS (East African Community, Indus Basin Development Fund), REGION_NAMES and TOTAL_GROUPS stay.
  • tests/fixtures/code_index/index.json.gz carries the types of its 491 parties, read from the dev graph.
  • Conformance row C66i states the type rule.

Notes for reviewers

  • On the recorded index every one of the 279 DAC2a destinations keeps its side, and a test pins the five multilateral residuals and the Mekong Delta Project.
  • One donor-side change: Africa Finance Corporation, typed Organization and missing from the resolver's organisation records, becomes a multilateral donor in Search.
  • A new destination total typed DACGroup reads as bilateral. If OECD adds a multilateral grouping as a total, it reads bilateral until it is typed Organization or handled here. Totals are never population members, so this cannot change a bilateral sum; it affects a request that names that total.
  • The first dev deploy's verify ends no_pointer and the build publishes the first format-3 release before traffic moves. A hold on the format-2 pointer does not apply to format 3.

Testing: targeted suites (tests/code_index, tests/graph_release, tests/scope/test_provider.py, the DAC2a engine, mint and materialise tests) pass locally; full suite on CI.

The code index export writes the sorted graph types of every party, and the loader refuses a party row without them, so a release built before this change fails verification and is rebuilt before a deploy moves traffic.
destination_side reads each party's graph types: Country is bilateral, an official Organization multilateral, DACUnspecifiedParty residuals multilateral unless a bilateral total lists them, and DACRecipientUnallocatedByCountry residuals bilateral. Every destination total other than all recipients, all multilateral recipients and Organization-typed totals is bilateral. party_facts reads the Organization type instead of the entity resolver's organisation records. The hand-kept group totals, multilateral residuals and bilateral unallocated lists go.
A code index whose party rows carry no types is unreadable by this image, so the release format moves to 3 and each image reads its own pointer. The residuals bilateral totals list are memoised per index, the loader refuses a malformed types value, and prose that named the removed lists now names destination_side.
@jm-rivera
jm-rivera merged commit 0a051f1 into dev Nov 16, 2026
24 of 25 checks passed
@jm-rivera
jm-rivera deleted the fix/dac2a-destination-side-from-data branch November 16, 2026 09:09
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.

1 participant