SingleAppPaths

Filesystem-path conventions for single-document UI applications (the Single app today; any future non-Swing single-document host tomorrow). Single-document hosts deliberately use a flatter layout than the multi-document hosts (Scenario, Experiment, Simopt), nesting per-analysis rather than per-app under the active workspace:

<activeWorkspace>/
    <analysisFolder>/            ← appWorkspaceDir
      reports/                    ← reportsDir

Pure functions over Path / String — no Swing dependency, no live engine state.

Relationship to other path objects

  • ksl.app.session.AppWorkspacePaths covers the multi-document app convention (<workspace>/<sanitizeAppName(appName)>/output/<sanitizeAnalysisName(name)>/). Different convention, different consumers.

  • ksl.app.settings.WorkspaceLayout covers the scenario workflow §2 runId-keyed layout (<workspace>/output/<runId>/).

  • ksl.app.optimization.paths.OptimizationPaths adds Simopt's run-NNN subdirectories and trace-file conventions on top of the multi-document layout.

Substrate-level API — usable by any UI shell.

Properties

Link copied to clipboard
const val UNTITLED: String

Canonical "no analysis name yet" sentinel. Treated by appWorkspaceDir as equivalent to a blank analysis name so the modelName fallback applies. Hosts that surface a default analysis name to the user typically display this string.

Functions

Link copied to clipboard
fun analysisFolder(analysisName: String): String

Filesystem-segment-safe form of analysisName for the single-app layout. Differs from ksl.app.config.sanitizeAnalysisName in three ways:

Link copied to clipboard
fun appWorkspaceDir(activeWorkspace: Path, analysisName: String, modelName: String): Path

Resolve the single-app's workspace directory for a given (analysisName, modelName) pair. Three-tier fallback:

Link copied to clipboard
fun reportsDir(appWorkspace: Path): Path

Resolve <appWorkspace>/reports/ — the canonical reports directory under a single-app workspace. Convenience for hosts that materialise rendered reports into the standard subdirectory. Not created by this helper.