feat: init graph-comparator-service#5
Open
plc-dev wants to merge 6 commits into
Open
Conversation
added 6 commits
April 30, 2026 16:13
- File names now follow Python convention (snake_case of class name). - JsonComparator renamed to GraphComparator since the interface operates on parsed Graph objects, not raw JSON. - DiffOp type alias renamed to DiffOpType to avoid clash with DiffOperation class. - Factory functions use create_ prefix instead of get_. - Service identifiers anglicized: vergleicher → graph-comparator.
…BC (#7) DefaultComparator inherited from no base class, breaking the contract: Python could not verify that the class fulfils the GraphComparator interface, and static analysis had no way to type-check callers. - Add GraphComparator as base class - Replace Any with Graph in compare() signature - Remove unused Any import Refs #7
) count_nodes_by_type / count_edges_by_kind used Any instead of Graph, hiding type errors from static analysis.Four helper functions (build_index, edge_pair_id, find_edge_indexes, get_unique_edge) existed as stubs with raise NotImplementedError behind an unnecessary TYPE_CHECKING guard. - Graph, Node, Edge imported directly (no circular-import risk) - Any replaced with concrete types in count_* signatures - All four helpers implemented - Misplaced docstrings and dead TYPE_CHECKING block removed Refs #7
…ace from factory (#7) normalize_graphs and compare_graphs received Any even though they are only ever called after validate_input, which guarantees Graph objects. create_feedback_builder returned the concrete DefaultFeedbackBuilder instead of the FeedbackBuilder interface, leaking the implementation detail to all callers. - normalize_graphs / compare_graphs: Any -> Graph in signature - create_feedback_builder return type: DefaultFeedbackBuilder -> FeedbackBuilder - Import FeedbackBuilder interface, remove leftover inline comments Any is intentionally kept where raw JSON arrives before validation: CompareRequest fields, validate_input, and run_comparison_pipeline. Refs #7
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.
No description provided.