forked from SWISDATA/processintel
ui.genetic_miner: the genetic miner reruns on every interaction after a failed run #12
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#12
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: medium (after one failure, every click starts a full genetic run)
Where
app/ui/genetic_miner_ui/genetic_miner_controller.py:136-150,:165-194app/ui/genetic_miner_ui/genetic_miner_view.py:81-83Problem
The Run Genetic Mining button sets
st.session_state.rerun_genetic_miner = True. The flag is only reset at the end of a successfulperform_mining():If mining raises (e.g. a
GraphExceptionfrom #7, or anyExceptioncaught at line 190), the flag staysTrue. Bothrun()andhave_parameters_changed()check it, so every subsequent interaction (toggling Show Happy Path, opening an expander, …) starts the full genetic algorithm again. With the defaults that is 500 individuals × 100 generations, and it fails again each time.Steps to reproduce
Start, see #7)Expected behavior
The miner only runs again when the user clicks Run Genetic Mining.
Actual behavior
The full genetic run starts again on every interaction.
Fix
Reset the flag in a
finally:block, or before starting the run.from
issues/BUG-012-genetic-rerun-flag-not-reset-after-failure.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The missing
finallyreset is a real bug. Please replace “every interaction” with “every interaction that triggers a script rerun.” The ordinaryst.expanderused here has no state callback; merely opening it does not invoke another genetic run. A widget toggle does. Also, the expected behavior is not exclusively “only the Run button”:have_parameters_changed()deliberately includes shared log-filter changes (lines 109–111), and the page's information text advertises that behavior. The fix should prevent unrelated reruns from restarting a failed run while preserving intended filter-triggered mining.Code references: app/ui/genetic_miner_ui/genetic_miner_controller.py:136, app/ui/genetic_miner_ui/genetic_miner_controller.py:100, app/ui/genetic_miner_ui/genetic_miner_view.py:13.