Skip to content

feat(registry): register the bilateral_reading_unavailable Search warning - #54

Merged
jm-rivera merged 5 commits into
devfrom
feat/bilateral-reading-unavailable-warning
Nov 15, 2026
Merged

jm-rivera merged 5 commits into
devfrom
feat/bilateral-reading-unavailable-warning

Conversation

@jm-rivera

@jm-rivera jm-rivera commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Registers bilateral_reading_unavailable, a Search warning on the raw_text, parsed and dataset_resubmit doors, and a registry of the reasons a warning carries in params.why. The warning marks an answer or reading of a published total ODA table, on a part with no provider axis and no provider entry asking for total ODA, whose bilateral reading is unavailable or undecided, so its figures include donors' core contributions to multilateral agencies. It carries the reading's spec_id, and params.why names one of the reasons spec-kit's warning-reason registry lists for it. Reasons are added to that file over time, and the code's frozen definition stays fixed.

Changes

  • registries/codes.json and its mirror python/spec-kit/src/dfo_spec_kit/registry/codes.json: the new entry, owned by search.
  • registries/warning-reasons.json, schema schemas/registry/warning-reason-registry.schema.json, validator tools/validate_warning_reasons.py and mirror python/spec-kit/src/dfo_spec_kit/registry/warning-reasons.json: five reasons, destination_unclassified, option_not_covered, read_window_not_covered, scope_undecided and slot_not_served, whose entry declares the extra params.slot.
  • dfo_spec_kit.registry.WARNING_REASONS, WarningReason and load_warning_reasons, listed in EXPORTS.md, with tests in tests/test_registry.py; validator tests in tools/tests/test_validate_warning_reasons.py.
  • .github/workflows/ci.yml: a step runs the new validator.
  • READMEs in registries/, schemas/registry/ and tools/, and the CHANGELOG entries under Unreleased.

Notes for reviewers

dfo-apis's code-registry binding test needs the served and registered codes to match one to one, so this PR and the dfo-apis change that emits the warning merge close together.

Testing: validate_registry.py (268 entries), validate_limit_registry.py (7), validate_unit_registry.py (88) and validate_warning_reasons.py (5) pass; tests/test_registry.py 18 passed; the registry and warning-reason validator tests in tools/tests 51 passed.

…ning

Search raises bilateral_reading_unavailable on a DAC2a total-ODA part with
no provider axis when the bilateral reading cannot apply (the destination
population is unavailable, the composite does not cover the window, or it
cannot serve a bound slot), so the part reads total ODA and says so.
Registered for search.resolve on the raw_text, parsed and dataset_resubmit
doors in registries/codes.json and its package mirror.
…ts reasons

The definition is published once a release carries it, so it states the meaning in client terms and leaves the list of params.why values to the Search API conformance document. It covers a reading as well as an answer, and the undecided case.
Add registries/warning-reasons.json with its schema, validator, bundled mirror and the dfo_spec_kit.registry.WARNING_REASONS accessor. It lists the five params.why reasons of bilateral_reading_unavailable: destination_unclassified, option_not_covered, read_window_not_covered, scope_undecided and slot_not_served. The warning's definition now names the provider-axis condition and points at the registry for its reasons.
…helpers

Warning reasons gain a lifecycle and optional params, and tools/validate_warning_reasons.py refuses a reason under a refusal or retired code and, against the latest release tag, a removed or redefined reason. tools/registry_checks.py holds the helpers the registry validators share, and each failure names its file. scope_undecided no longer promises a retry, option_not_covered and read_window_not_covered now differ in what they state, and the code definition names the registry without a repo path.
…e pattern

The warning-reason validator checks what the limit-name validator checks, plus that each code is an active warning, and the three older validators are as on dev. Reasons carry no lifecycle, and WarningReason holds its params as sorted pairs so it is hashable.
@jm-rivera
jm-rivera merged commit 67a0fed into dev Nov 15, 2026
22 checks passed
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