// // ProfileLayout.swift // Museion // // #182: the ONE owner of the Hermes profile layout — the root default and // every per-profile path derivation. The provisioner, the settings writer, // and backup/restore build paths only through here; no literal // profile-root string lives outside this module (pinned in // ProfileLayoutTests — a layout change is this module + that one suite). // // Deliberately NOT layout-owned: the RESTORE.md copy names // `~/.hermes/profiles` as prose (static text that must outlive the app), // and the backup ps scan greps argv text, not filesystem paths. // import Foundation nonisolated enum ProfileLayout { /// The profiles base dir (`~/.hermes/profiles`; tests inject their own root). static let defaultRoot = ("~/.hermes/profiles" as NSString).expandingTildeInPath /// `/` — the profile's home dir. static func profileDir(_ profile: String, root: String) -> String { (root as NSString).appendingPathComponent(profile) } /// The profile's `.env` — provider keys (the writer's fan-out surface). static func envFile(in profileDir: String) -> String { (profileDir as NSString).appendingPathComponent(".env") } /// The configured marker — written by the provisioner after the config /// rail completes; marker-gating keeps a re-pass from stomping a user's /// later Settings change. static func configuredMarker(in profileDir: String) -> String { (profileDir as NSString).appendingPathComponent(".museion-provisioned") } /// The engine gateway's pid file (the backup liveness gate reads it). static func gatewayPID(in profileDir: String) -> String { (profileDir as NSString).appendingPathComponent("gateway.pid") } /// The profile's skills dir — the symlink farm into the ONE master copy. static func skillsDir(in profileDir: String) -> String { (profileDir as NSString).appendingPathComponent("skills") } }