Phase 1: Session-Scoped Graph Metadata, Typed Snapshots, and Edge Ownership Refactor#227
Open
griffinmilsap wants to merge 7 commits intodevfrom
Open
Phase 1: Session-Scoped Graph Metadata, Typed Snapshots, and Edge Ownership Refactor#227griffinmilsap wants to merge 7 commits intodevfrom
griffinmilsap wants to merge 7 commits intodevfrom
Conversation
…data # Conflicts: # src/ezmsg/core/backend.py
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 introduces phase-1 support for high-level graph metadata in
GraphServerwhile preserving existing low-level graph APIs.Core outcomes:
Why
We need
GraphServerto become a useful source of truth for both topology and high-level graph structure:What Changed
1) GraphContext Session Control Plane
GraphContext.connect/disconnectnow require an active session context.register_metadataandsnapshotoperate through session commands.2) Session Metadata + Snapshot Typing
src/ezmsg/core/graphmeta.py:GraphMetadataComponentMetadata,CollectionMetadata,UnitMetadataStreamMetadata,InputStreamMetadata,OutputStreamMetadataTaskMetadata,DynamicSettingsMetadataEdgeSnapshotSessionGraphSnapshotGraphContext.snapshot()now returnsGraphSnapshot.3) Session Transport
pickle.GraphMetadata).4) Initial Settings Payload
initial_settingsnow includes:Nonewhen pickling fails),dataclasses.asdict(...)for dataclass settings (recursive),repr(...).5) Edge Ownership Model
DAG(edge_owners) to avoid mirrored ownership state inGraphServer.Noneowner represents persistent edges.6) Session-as-Client Unification
SessionInfomoved tonetprotocoland handled as a standard graph client type.7) Backend Metadata Collection
crawl_components(...).INPUT_SETTINGSinlet.Behavior Notes
GraphService.connect/disconnectremains available for persistent graph edges.Caveats
Pickle-based metadata/snapshot transport assumes compatible class definitions between communicating environments. GraphServer maintains pickled byte representation of initial settings dataclass, but does not attempt to unpickle because of this. Text/Dict-based representations of initial settings are present to allow for visualization/introspection even if server does not have compatible class definitions in its virtual environment.