Route PowerShell through Calamari (opt-in via env flag)
Summary
Connects PR-4's capability (Calamari can run PowerShell) to the Tentacle routing decision. Default OFF — zero behaviour change. Operators with custom PowerShell package deploys opt in to gain the rewriter + convention pipeline for PS scripts.
Two co-dependent changes (both required)
The prior IsCalamariCompatible docstring + drift test warned that flipping PowerShell routing needs BOTH halves:
-
Gate —
IsCalamariCompatible(PowerShell)returns true only whenSQUID_TENTACLE_CALAMARI_POWERSHELLis truthy (1/true/yes/on). Bash always qualifies. Default (unset) = PowerShell on the direct launcher, exactly as before. -
Per-syntax
--scriptpath —BuildCalamariProcessStartInfonow emits--script=script.ps1for PowerShell (was hardcodedscript.sh). This was the co-dependent crash cause: Tentacle wrotescript.ps1, Calamari readscript.sh→FileNotFoundException.
Why opt-in (not default-on)
Server-side PS-emitting paths (IIS deploy, Windows upgrade) already inline variables via $SquidParameters and don't need Calamari's bootstrap; routing them through the extra Calamari child changes the process-tree / cancellation / output-capture path. The env gate keeps the default conservative + makes it reversible. Operators who want rewriters on their custom PS deploys flip the flag explicitly.
Test plan
-
Tentacle.Tests: 1467/1467 -
Build: 0 errors -
Default-env truth table — PowerShell stays FALSE (back-compat pin) -
Truthy theory (5 cases) → PowerShell routes through Calamari -
Falsy theory (6 cases) → stays off; bash never affected -
CalamariPowerShellEnvVarconstant pinned (Rule 8) -
--script=script.ps1for PowerShell,script.shfor bash -
Staging: opt-in agent runs a custom .ps1package deploy through Calamari with SubstituteInFiles applied
Non-breaking guarantee
| Surface | Status |
|---|---|
| Default agent (flag unset) | Identical — PowerShell on direct launcher, bash on Calamari |
| Existing bash Calamari routing |
--script=script.sh unchanged |
| IIS / upgrade PS paths | Unchanged unless operator sets the flag (then they route through Calamari, gaining nothing but losing nothing — variables already inlined) |
BuildCalamariProcessStartInfo signature |
Internal — only LocalScriptService + its tests; all call sites updated |
| SquidWeb | Untouched |