forked from SWISDATA/processintel
mining: decouple the mining models from Streamlit session state #46
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#46
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: improvement (high: the models cannot be used or tested outside Streamlit)
Where
app/mining_algorithms/base_mining.py:3,:113-124,:755-783app/io_operations/export_operations.py:5,:130-135Problem
BaseMining, the domain layer, importsstreamlitand:node_freq_threshold_*,edge_freq_threshold_*,last_*) intost.session_statein its constructor;_sync_thresholds, reads user input fromst.session_stateto decide which threshold "moved last", and writes corrected values back.ExportOperations.export_to_xes_bytesalso depends onst.session_state.session_tmp_dir.Consequences:
generate_graph, but the model overrides them from session state, so behaviour depends on hidden UI state (#11).It also blocks running mining in a worker (#54).
Fix
generate_graph(params) -> (graph, effective_params)streamlitimport from the mining and IO layersfrom
issues/ARCH-001-mining-models-coupled-to-streamlit-session-state.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The hidden session-state dependency and two sources of truth are supported. However, “the models cannot be used or tested outside Streamlit” is too strong. The repository already runs miner unit tests in ordinary Python bare mode, and I constructed a
HeuristicMiningmodel and generated a graph with nodesStart,End,aoutside a Streamlit script. Streamlit emits context warnings; it does not categorically prohibit execution. The accurate concern is that standalone use is noisy and not reliably isolated/pure, and explicit parameters can be overridden by hidden state. XES-byte export additionally requires its temp-directory session key. Decoupling is still justified.Code references: app/mining_algorithms/base_mining.py:113, app/mining_algorithms/base_mining.py:755.