Workspace Layout
Pure path-resolution helpers for the workspace layout described in scenario workflow §2. Subdirectories are created lazily — the resolver methods accept a flag controlling whether to create on miss.
The workspace is the outer layout under user control; the engine's per-model OutputDirectory is the inner layout. See bindOutputDirectory for the bridge that ties them together.
Functions
Abbreviates a path for compact display in a status bar. Returns the original toString() when shorter than maxLen; otherwise collapses the leading segments to ~/.../ (or .../ when not under the user's home) and keeps the last three segments.
Redirects model's Model.outputDirectory to the workspace's per-run output folder. The engine's excelDir, dbDir, csvDir, plotDir subfolders are auto-created underneath by OutputDirectory's constructor — no engine change required.
Resolves <workspace>/configs/, optionally creating it.
Resolves <workspace>/reports/<runId>/, optionally creating it.
Builds a sortable, filesystem-safe runId. When scenariosFileName is non-null its stem (no extension) is prepended after sanitization; any character outside [A-Za-z0-9._-] is replaced with _.