Skip to content

fix(schema): hotfix v0.5.9 — add case management kinds to envelope schema validator - #28

Merged
willwebster5 merged 2 commits into
masterfrom
hotfix/case-management-kinds-schema
Jun 29, 2026
Merged

fix(schema): hotfix v0.5.9 — add case management kinds to envelope schema validator#28
willwebster5 merged 2 commits into
masterfrom
hotfix/case-management-kinds-schema

Conversation

@willwebster5

Copy link
Copy Markdown
Owner

Summary

  • validate_authored_envelope() rejected all three case management kinds (CaseNotificationGroup, CaseSla, CaseTemplate) with "is not one of ['Detection', 'SavedSearch', ...]" — the kind enum in schemas/envelope.schema.json was never updated when those kinds were added to KIND_TO_TYPE in v0.5.8
  • One-line fix: add the three kinds to the JSON Schema enum
  • Drift-guard test added (test_schema_kind_enum_matches_kind_to_type) so the schema enum and KIND_TO_TYPE cannot diverge again

Root cause

envelope.py KIND_TO_TYPE (Python) and envelope.schema.json kind.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 used load_envelopes + provider.validate_template but never called validate_authored_envelope(), so the gap was missed.

Test plan

  • Wrote failing tests first (RED): both correctly failed with the stale enum message
  • test_validate_authored_envelope_accepts_case_kinds — green after fix
  • test_schema_kind_enum_matches_kind_to_type — green after fix (drift guard)
  • Full suite: 860 passed

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.
@willwebster5
willwebster5 merged commit 4d1f8ba into master Jun 29, 2026
6 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