logs.splits: inductive sequence and loop splits misbehave on traces that do not fit the cut #29

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

Severity: low (plausible: found by reading the code, not reproduced)

Where

  • app/logs/splits.py:91-96, :139, :150-168
  • app/graphs/cuts.py:79-92

Problem

Found by code review; not reproduced yet.

  • sequence_split walks the partitions with next(partition_iter). If an event belongs to an earlier partition than the current one, the iterator runs out and raises StopIteration, which is not caught, so mining crashes. sequence_cut orders partitions with a selection sort over a reachability check on one representative node per partition. That check is not guaranteed to be transitive for greedily merged partitions, so a wrong order is possible.
  • loop_split uses find_correct_partition, which returns index -1 for unknown events. The event is then silently written into the last partition's sub-log (split_logs[-1]).

Steps to reproduce

Not reproduced yet. A candidate is a log where the sequence cut merges partitions greedily so that the representative-node reachability check gives a wrong order. Property-based tests with random logs should find a concrete example.

Expected behavior

Events that do not fit the cut are skipped or handled, and mining completes.

Actual behavior (expected from the code)

StopIteration crash in sequence_split; events silently placed in the wrong sub-log in loop_split.

Fix

Make the splits tolerant (skip or log foreign events, as sequence_split_imf does with dynamic programming) and add property-based tests that feed random logs through cut and split.


from issues/BUG-029-sequence-and-loop-split-fail-on-inconsistent-partitions.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** low (plausible: found by reading the code, not reproduced) ## Where - `app/logs/splits.py:91-96`, `:139`, `:150-168` - `app/graphs/cuts.py:79-92` ## Problem *Found by code review; not reproduced yet.* - `sequence_split` walks the partitions with `next(partition_iter)`. If an event belongs to an **earlier** partition than the current one, the iterator runs out and raises `StopIteration`, which is not caught, so mining crashes. `sequence_cut` orders partitions with a selection sort over a reachability check on one representative node per partition. That check is not guaranteed to be transitive for greedily merged partitions, so a wrong order is possible. - `loop_split` uses `find_correct_partition`, which returns index `-1` for unknown events. The event is then silently written into the **last** partition's sub-log (`split_logs[-1]`). ### Steps to reproduce Not reproduced yet. A candidate is a log where the sequence cut merges partitions greedily so that the representative-node reachability check gives a wrong order. Property-based tests with random logs should find a concrete example. ### Expected behavior Events that do not fit the cut are skipped or handled, and mining completes. ### Actual behavior (expected from the code) `StopIteration` crash in `sequence_split`; events silently placed in the wrong sub-log in `loop_split`. ## Fix Make the splits tolerant (skip or log foreign events, as `sequence_split_imf` does with dynamic programming) and add property-based tests that feed random logs through cut and split. --- from `issues/BUG-029-sequence-and-loop-split-fail-on-inconsistent-partitions.md` (code analysis of commit 6bcc646, 2026-10-03)
Author
Owner

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

Review: unproven production trigger.

Direct helper misuse reproduces both outcomes: sequence_split({('b','a'):1}, [{'a'},{'b'}]) raises StopIteration; loop_split({('a','unknown'):1}, [{'a'},{'b'}]) puts unknown in the last sub-log. That does not establish a mining failure with partitions generated from the same log.

The alleged non-transitive representative ordering is unproven. sequence_cut merges mutually reachable and incomparable node pairs before ordering; those constraints must be considered. Exhaustively checking all 4,096 directed four-node graphs found zero cuts with a backward cross-partition edge. This bounded check is not a proof for all graphs, but the production trigger should remain inconclusive rather than presented as an expected crash. Prefer validating partition coverage/order and reporting inconsistency; silently skipping foreign events in ordinary Inductive Mining would silently discard log data and is not an established fix.

Code references: app/logs/splits.py:91, app/graphs/cuts.py:49, app/mining_algorithms/inductive_mining.py:190.

Reviewed by **Codex (GPT-6)** against origin/main [`6bcc646eb464`](https://code.swisdata.eu/ffrauenberger/ProcessIntel/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4). **Review: unproven production trigger.** Direct helper misuse reproduces both outcomes: `sequence_split({('b','a'):1}, [{'a'},{'b'}])` raises `StopIteration`; `loop_split({('a','unknown'):1}, [{'a'},{'b'}])` puts `unknown` in the last sub-log. That does not establish a mining failure with partitions generated from the same log. The alleged non-transitive representative ordering is unproven. `sequence_cut` merges mutually reachable **and** incomparable node pairs before ordering; those constraints must be considered. Exhaustively checking all 4,096 directed four-node graphs found zero cuts with a backward cross-partition edge. This bounded check is not a proof for all graphs, but the production trigger should remain inconclusive rather than presented as an expected crash. Prefer validating partition coverage/order and reporting inconsistency; silently skipping foreign events in ordinary Inductive Mining would silently discard log data and is not an established fix. Code references: [app/logs/splits.py:91](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/logs/splits.py#L91), [app/graphs/cuts.py:49](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/graphs/cuts.py#L49), [app/mining_algorithms/inductive_mining.py:190](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/mining_algorithms/inductive_mining.py#L190).
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#29
No description provided.