forked from SWISDATA/processintel
mining.fuzzy: nodes are assigned to the wrong cluster by substring matching #5
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: critical (similar activity names silently give a wrong fuzzy model)
Where
app/mining_algorithms/fuzzy_mining.py:158-162(get_node_id)app/mining_algorithms/fuzzy_mining.py:640-644(__get_cluster_where_node)app/mining_algorithms/fuzzy_mining.py:497-501,:530-539,:565-569(splitting cluster strings)Problem
Fuzzy miner clusters are stored as strings (member names joined with
cluster_seperator = "---"), and membership is tested with Python'sinon that string:If one activity name is a substring of another member's name (
Pay/Pay Invoice,Check/Check Credit,A/A1), the node is matched to the wrong cluster:build_fuzzy_graphusesget_node_idfor start and end edges, so start/end arcs can point to an unrelated cluster.An activity whose name contains
---is split into fake members when the cluster string is split again;self.filtered_events.index(src)then raisesValueErrorand mining crashes.Steps to reproduce
PayandPay Invoice(or an activity whose name contains---)Pay Invoiceis part of a clusterExpected behavior
Payis matched only to the cluster it belongs to. Activity names containing---are handled like any other name.Actual behavior
Payis matched to the cluster that containsPay Invoice, and its edges are drawn to and aggregated into that cluster. Names containing---crash mining withValueError.Fix
Represent clusters as
frozenset/tupleof activities, keep adict[node -> cluster_id]for lookups, and never encode the structure into strings.from
issues/BUG-005-fuzzy-miner-cluster-lookup-uses-substring-match.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The substring lookup and
---representation defects are real, but thePay/Pay Invoicereproduction needs a qualification.__get_cluster_where_nodeis called for activities already present inlist_of_clustered_nodes(lines 487–523). IfPayremains an ordinary node, its regular graph edges are not automatically aggregated into thePay Invoicecluster. Its start/end lookup can still be wrong becauseget_node_idsearches every cluster string. To demonstrate wrong aggregated edges, putPayin a different cluster and arrange for thePay Invoicecluster to be searched first. An activity containing---triggers the splitting problem when it is represented as a cluster member.Code references: app/mining_algorithms/fuzzy_mining.py:158, app/mining_algorithms/fuzzy_mining.py:487, app/mining_algorithms/fuzzy_mining.py:640.