Introduce versioned Tentacle install-layout foundation
Summary
- Add
TentacleLayout— the single source of truth for a versioned install layout: per-version directories underversions/<v>selected by a stablecurrentpointer. A later upgrade activates a new version by atomically repointingcurrent, leaving the previously-running version directory byte-for-byte untouched and instantly restorable on failure. - Make
ServiceCommand.ResolveServiceExecutionlayout-aware: a versioned install with a livecurrentpointer registers the service against the stable pointer path; flat installs keep today's behaviour verbatim. -
Non-breaking + dormant: nothing creates the versioned layout yet, so
TryGetInstallRootFromRunningDirreturns null on every existing agent and behaviour is identical to today. The install scripts adopt the layout in a follow-up; this PR lands the mechanism + its tests first.
This is the foundation of a series making Windows + Linux upgrades fully failure-isolated — an upgrade never touches the running version directory, so any failure (download, verify, swap, restart, health check, even a failed rollback) leaves the old version intact. VersionsDir/VersionDir/VersionBinaryPath are the layout contract consumed by the follow-up install-script + upgrade PRs.
Test plan
-
TentacleLayoutTests(19): contract constants pinned, pure path composition (cross-OS viaPath.Combine),TryGetInstallRootFromRunningDir(version-dir / current-pointer / trailing-sep / flat / unrelated / empty / null),IsVersioned(flat / real-dir pointer / symlink pointer). -
ServiceCommandTests(+7): flat → process path verbatim; versioned + live pointer → stable pointer path (both running shapes); versioned-shape-but-pointer-not-live → safe fallback; empty process path fallback; null base dir fallback. ExistingResolveServiceExecution/GenerateUnitFiletests unchanged. -
Full Squid.Tentacle.Tests: the 29 new/affected tests green. Pre-existingScriptExecutionfailures on this dev host are identical with and without this change (verified by stashing) — not a regression.