Skip to content

Introduce versioned Tentacle install-layout foundation

Placeholder ppxd requested to merge feat/tentacle-versioned-layout-foundation into main

Summary

  • Add TentacleLayout — the single source of truth for a versioned install layout: per-version directories under versions/<v> selected by a stable current pointer. A later upgrade activates a new version by atomically repointing current, leaving the previously-running version directory byte-for-byte untouched and instantly restorable on failure.
  • Make ServiceCommand.ResolveServiceExecution layout-aware: a versioned install with a live current pointer 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 TryGetInstallRootFromRunningDir returns 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 via Path.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. Existing ResolveServiceExecution / GenerateUnitFile tests unchanged.
  • Full Squid.Tentacle.Tests: the 29 new/affected tests green. Pre-existing ScriptExecution failures on this dev host are identical with and without this change (verified by stashing) — not a regression.

Merge request reports

Loading