Solver option trust (developer)
The code-level rules behind Which option folders are trusted and What the database may set. Where the option files come from (the folder ladder) and the option stack are in architecture.md "Runtime options", item 6.
- Which names are allowed. The database layers (
solver_arguments,solver_mip_gap) take only names inengine/solve/solver_catalogue/<solver>.json(_solver_catalogue, written bytools/solver_catalogue.pywith a reviewed class per name:plain/file/local_only/flextool), checked for every solve before the first (check_run_solver_options) and again per solve (check_database_solver_option). HiGHS names the installed highspy knows as bool / int / double pass too. The per-user switch for unlisted names (flextool/_local_solver_settings.py:FLEXTOOL_ALLOW_UNLISTED_SOLVER_PARAMETERS, elseuser_config_dir()/solver_settings.json) is never read from a database, project, workspace or flag. Option files and flags warn on an unlisted name and pass it. Project import screens shipped files with the run's own rule for an untrusted file (_solver_dispatch.untrusted_option_file_problems:validate_solver_option+check_database_solver_optionper line) and holds a refused one back as<solver>.opt.review; export's privacy screen is the engine-freeflextool/_solver_option_rules.py. - Trust follows the source, per folder of the ladder (so per file). A folder the run found by itself (ladder tiers
2-4, and the GUI's
--workspace-solver-config-dirfolders) is trusted only when its parent (the workspace, or the project forprojects/<P>/solver_config) is intrusted_workspacesof the settings file (SolverConfigSource.layer_note); otherwiseSolverOptionFiles.untrusted_note(solver), from the folder that gave that solver's file, is handed toresolve_commercial_options/_resolve_effective_highs_optionsand each file line goes throughcheck_database_solver_option(untrusted=...).--solver-config-dir/FLEXTOOL_SOLVER_CONFIG_DIRand Spine Toolbox projects (code) are trusted. A file that is byte for byte a shipped template is trusted wherever it lies; FlexTool's own file is told by content (is_unedited_template), never by the origin text. - Adding and removing trust. Only
ensure_runtime_files(when it createssolver_config/or finds only unedited templates,holds_only_flextool_defaults), the GUI's project create / open (note_project_set_up_here: only with nothing received waiting,awaits_review) and the GUI's explicit "trust this workspace / project" add to the list; project import, the first-open rename ofimported_solver_config/and project deletion take the path off (forget_trusted_folder); nothing inside a workspace (templates/project_folder.txtincluded) is a trust anchor. An entry is bound to the folder trusted (folder_identity: device + inode + birth time, Windows volume serial + file ID + creation time,st_ctimebefore Python 3.12; ext4 reuses a deleted folder's inode at once, so the birth time is needed, and a stored one must be matched) and to its.opthashes (TrustedFolder): a replaced folder is untrusted (trust_status), and a changed file is covered only whenonly_you_can_change(POSIX owner, not group/other-writable unless the user's private group; on Windows a plain file, as owner and ACL are not read) —read_solver_option_fileskeeps that per-file verdict inSolverOptionFiles.file_notes. Text entries of 4.4 development builds are bound on first read; relative entries are refused; a relativeFLEXTOOL_USER_HOME/XDG_CONFIG_HOMEis ignored (user_dirs; never depends on the start folder), and a settings file inside the folder judged (_check_settings_outside) makes its trust unreadable. The settings file is refused on read when not UTF-8 or (POSIX) another account owns or can write it (_settings_file_problem). - The terminal route is
flextool-trust-workspace(cli/cmd_trust_workspace.py): a typed, answered command, not a run flag (a Toolbox project carries tool command lines, and anything that can start the command unasked can already run code). It refuses a stdin that is not a terminal and has no--yes, escapes what it shows (_safe_text.printable), and trusts exactly the bytes it showed (show_folder→apply_settings(workspace_shown=),ShownFilesChanged), as does the window's box with the files as the dialog found them. - Solver wrapper. A commercial solver may run behind this computer's solver wrapper
(
_local_solver_settings.solver_wrapper:FLEXTOOL_SOLVER_WRAPPER_GUROBIand its CPLEX, XPRESS, COPT twins, elsewrappersin the same file;check_wrapperholds the rules), checked for every solver of the run before the first solve (check_run_solver_wrappers) and again before each start;_solve_commercial_subprocessprepends it to the solver's argv (no shell; the solver path is absolute,_find_solver_binaryskips relative and, on Windows, current-folderPATHentries), logs theRunning ... through the solver wrapperline with the program and its argument count only (the AI assistant sends run logs out) and notessolver_wrappersin full in the run record (export keeps only the program and the count). - The settings file (written 0600) is written only by the GUI's Solver options → On this computer,
flextool-trust-workspaceandensure_runtime_files; no assistant tool, database value, project file or flag writes or sets it.