Skip to content

feat: init graph-comparator-service#5

Open
plc-dev wants to merge 6 commits into
masterfrom
init_graph_comparator
Open

feat: init graph-comparator-service#5
plc-dev wants to merge 6 commits into
masterfrom
init_graph_comparator

Conversation

@plc-dev
Copy link
Copy Markdown
Member

@plc-dev plc-dev commented Apr 30, 2026

No description provided.

Duke 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
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.

2 participants