converters.dfg: the fuzzy graph converter calls private miner methods via name mangling #50

Open
opened 2026-10-06 13:52:53 +00:00 by ffrauenberger · 1 comment
Owner

Severity: improvement (medium)

Where

  • app/converters/dfg_converter.py:119-185
  • app/mining_algorithms/fuzzy_mining.py:150-156, :330-382, :659-681, :789-811

Problem

DFGConverter.build_fuzzy_graph receives the miner object and does:

miner.graph = graph   # make sure helper methods write to the same graph
add_clustered_nodes = getattr(miner, "_FuzzyMining__add_clustered_nodes_to_graph")
...

The converter depends on Python name mangling of private methods, and the miner's helpers mutate self.graph and self.cluster_id_mapping as side effects. Renaming the class or a method breaks this silently, and the converter abstraction (separating mining from visualization) does not hold for the fuzzy miner. The other converters receive data objects (HeuristicDFGData, AlphaPetriNetData).

Fix

The fuzzy miner produces a plain result structure (nodes, clusters, edges with metrics), like the heuristic miner, and the converter builds the graph only from that.


from issues/ARCH-005-converters-reach-into-private-miner-internals.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** improvement (medium) ## Where - `app/converters/dfg_converter.py:119-185` - `app/mining_algorithms/fuzzy_mining.py:150-156`, `:330-382`, `:659-681`, `:789-811` ## Problem `DFGConverter.build_fuzzy_graph` receives the **miner object** and does: ```python miner.graph = graph # make sure helper methods write to the same graph add_clustered_nodes = getattr(miner, "_FuzzyMining__add_clustered_nodes_to_graph") ... ``` The converter depends on Python name mangling of private methods, and the miner's helpers mutate `self.graph` and `self.cluster_id_mapping` as side effects. Renaming the class or a method breaks this silently, and the converter abstraction (separating mining from visualization) does not hold for the fuzzy miner. The other converters receive data objects (`HeuristicDFGData`, `AlphaPetriNetData`). ## Fix The fuzzy miner produces a plain result structure (nodes, clusters, edges with metrics), like the heuristic miner, and the converter builds the graph only from that. --- from `issues/ARCH-005-converters-reach-into-private-miner-internals.md` (code analysis of commit 6bcc646, 2026-10-03)
Author
Owner

Reviewed by Codex (GPT-6) against origin/main 6bcc646eb464.

Review: partially correct.

The abstraction and private-name coupling findings are confirmed. Correct “renaming the class or a method breaks this silently”: getattr(miner, '_FuzzyMining__...') has no default, so a missing mangled method raises AttributeError immediately. The non-genetic base controller only catches graph exceptions, so this would normally surface as an exception page. The existing side effects and eager publication of miner.graph are separate real concerns. Producing a plain fuzzy result structure remains a sound refactoring direction.

Code references: app/converters/dfg_converter.py:124.

Reviewed by **Codex (GPT-6)** against origin/main [`6bcc646eb464`](https://code.swisdata.eu/ffrauenberger/ProcessIntel/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4). **Review: partially correct.** The abstraction and private-name coupling findings are confirmed. Correct “renaming the class or a method breaks this silently”: `getattr(miner, '_FuzzyMining__...')` has no default, so a missing mangled method raises `AttributeError` immediately. The non-genetic base controller only catches graph exceptions, so this would normally surface as an exception page. The existing side effects and eager publication of `miner.graph` are separate real concerns. Producing a plain fuzzy result structure remains a sound refactoring direction. Code references: [app/converters/dfg_converter.py:124](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/converters/dfg_converter.py#L124).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ffrauenberger/ProcessIntel#50
No description provided.