Repository navigation
feat(registry): register the bilateral_reading_unavailable Search warning - #54
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inparams.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, andparams.whynames 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.jsonand its mirrorpython/spec-kit/src/dfo_spec_kit/registry/codes.json: the new entry, owned by search.registries/warning-reasons.json, schemaschemas/registry/warning-reason-registry.schema.json, validatortools/validate_warning_reasons.pyand mirrorpython/spec-kit/src/dfo_spec_kit/registry/warning-reasons.json: five reasons,destination_unclassified,option_not_covered,read_window_not_covered,scope_undecidedandslot_not_served, whose entry declares the extraparams.slot.dfo_spec_kit.registry.WARNING_REASONS,WarningReasonandload_warning_reasons, listed inEXPORTS.md, with tests intests/test_registry.py; validator tests intools/tests/test_validate_warning_reasons.py..github/workflows/ci.yml: a step runs the new validator.registries/,schemas/registry/andtools/, 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) andvalidate_warning_reasons.py(5) pass;tests/test_registry.py18 passed; the registry and warning-reason validator tests intools/tests51 passed.