fix(schema): hotfix v0.5.9 — add case management kinds to envelope schema validator - #28
Merged
Merged
Conversation
validate_authored_envelope() rejected CaseNotificationGroup, CaseSla, and CaseTemplate because the JSON Schema kind enum was never updated when those kinds were added to KIND_TO_TYPE in v0.5.8. The Python provider registry and template discovery were correct; only the schema validator was stale. Adds a drift-guard test (test_schema_kind_enum_matches_kind_to_type) that asserts schema enum == KIND_TO_TYPE.keys() so the two cannot diverge again.
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.
Summary
validate_authored_envelope()rejected all three case management kinds (CaseNotificationGroup,CaseSla,CaseTemplate) with "is not one of ['Detection', 'SavedSearch', ...]" — thekindenum inschemas/envelope.schema.jsonwas never updated when those kinds were added toKIND_TO_TYPEin v0.5.8test_schema_kind_enum_matches_kind_to_type) so the schema enum andKIND_TO_TYPEcannot diverge againRoot cause
envelope.pyKIND_TO_TYPE(Python) andenvelope.schema.jsonkind.enum(JSON Schema) are two sources of truth for valid kinds. Only the Python side was updated in v0.5.8; the schema validator silently remained at 7 kinds. The v0.5.8 tests usedload_envelopes+provider.validate_templatebut never calledvalidate_authored_envelope(), so the gap was missed.Test plan
test_validate_authored_envelope_accepts_case_kinds— green after fixtest_schema_kind_enum_matches_kind_to_type— green after fix (drift guard)