Synthesize per-topic events from event instances with stream-parity tests#779
Open
Synthesize per-topic events from event instances with stream-parity tests#779
Conversation
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
This PR executes the event-instance parity plan by introducing a synthesis path that converts event instance metadata into initialized
Eventobjects grouped per topic.The goal is to make event-instance-derived events content-equivalent to stream-derived events on:
topicsourceidstategroupOperation parity is intentionally excluded; synthesized events are initialized by design.
What Changed
1) Model synthesis primitives
Event.synthesize_initialized(...)inaxis/models/event.py.TOPIC_TO_INACTIVE_STATEmapping to normalize inactive defaults for topics with non-numeric states.EventInstance.to_events()inaxis/models/event_instance.py:activewhere present)EventobjectsEventInstance.decode()against missingMessageInstance.2) Interface/lifecycle wiring
EventInstanceHandler.get_events_per_topic()inaxis/interfaces/event_instances.py.Vapix.initialize_event_instances()to populatevapix.event_instance_events: dict[str, list[Event]]inaxis/interfaces/vapix.py.3) Verification tests
tests/test_event_instances.pythat compare synthesized vs stream events for overlapping topics (PIR, Light Status, VMD4 profile) using the agreed parity fields.tests/test_vapix.pyto verifyinitialize_event_instances()populates synthesized per-topic events.Commit Breakdown
7e879e9Add event-instance to initialized-event synthesis primitivesd634b33Expose synthesized per-topic events from event instancesfb5b355Add parity tests for synthesized event-instance eventsValidation
uv run pytest tests/test_event_instances.py tests/test_vapix.py -vruff checkruff formatmypyNotes
EventManager.