Appointat commented on code in PR #737:
URL: https://github.com/apache/geaflow/pull/737#discussion_r2796532628


##########
geaflow-ai/src/operator/casts/casts/core/interfaces.py:
##########
@@ -0,0 +1,195 @@
+"""Core interfaces and abstractions for CASTS system.
+
+This module defines the key abstractions that enable dependency injection
+and adherence to SOLID principles, especially Dependency Inversion Principle 
(DIP).
+"""
+
+from abc import ABC, abstractmethod
+from typing import Any, Protocol
+
+import numpy as np
+
+
+class GoalGenerator(ABC):
+    """Abstract interface for generating traversal goals based on graph 
schema."""
+
+    @property
+    @abstractmethod
+    def goal_texts(self) -> list[str]:
+        """Get list of available goal descriptions."""
+        pass
+
+    @property
+    @abstractmethod
+    def goal_weights(self) -> list[int]:
+        """Get weights for goal selection (higher = more frequent)."""
+        pass
+
+    @abstractmethod
+    def select_goal(self, node_type: str | None = None) -> tuple[str, str]:
+        """Select a goal based on weights and optional node type context.
+
+        Returns:
+            Tuple of (goal_text, evaluation_rubric)
+        """
+        pass
+
+
+class GraphSchema(ABC):
+    """Abstract interface for graph schema describing structural 
constraints."""
+
+    @property
+    @abstractmethod
+    def node_types(self) -> set[str]:
+        """Get all node types in the graph."""
+        pass
+
+    @property
+    @abstractmethod
+    def edge_labels(self) -> set[str]:
+        """Get all edge labels in the graph."""
+        pass
+
+    @abstractmethod
+    def get_node_schema(self, node_type: str) -> dict[str, Any]:
+        """Get schema information for a specific node type."""
+        pass
+
+    @abstractmethod
+    def get_valid_outgoing_edge_labels(self, node_id: str) -> list[str]:

Review Comment:
   Good catch—GraphSchema should stay metadata‑only. I’ve updated the interface 
 to accept node_type (not node_id) and adjusted the call sites accordingly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to