Pin Windows diagnostic command contracts (W-D1h–W-D4h: cross-platform mirror of Linux D-section)
Summary
- Closes the Windows diagnostic command gap identified in the global audit. Mirrors Linux Section D (D1h–D4h) so operators on mixed Windows + Linux fleets running the same documented debug recipe see identical behaviour.
- 4 new tests: W-D1h (show-thumbprint round-trip), W-D2h (list-instances), W-D3h (show-config round-trip), W-D4h (new-certificate idempotency).
- Plus a defensive
WindowsTentacleHostStateCollection(mirrorsLinuxTentacleHostStateCollection) — serializes the 4 test classes that share%ProgramData%\Squid Tentacle\instances.jsonto prevent the parallel-execution race surfaced by first runner.
What this pins
| Test | Pin |
|---|---|
| W-D1h | show-thumbprint stdout matches register's payload thumbprint (round-trip identity contract) |
| W-D2h | list-instances shows all created instances + label headers (operator grep contract) |
| W-D3h | show-config returns persisted values + 'Detected Mode: Listening' + no cert-error fallback |
| W-D4h | new-certificate is load-or-create (NOT rotation despite name) — second call returns same thumbprint |
Why this matters
Operators debugging a failed-to-poll agent run show-thumbprint / show-config / list-instances — the documented debug recipe. If any layer of the round-trip drifts on Windows but not Linux (or vice versa), the cross-OS ops runbook silently lies for one platform. These pins close that gap.
First-runner discoveries
-
Empty
CertsPathcrash inShowThumbprintCommand: same Linux D4h iter 1 issue. Root cause:Program.cs's outerAddJsonFile(instanceConfigPath)is what makesTentacle:CertsPathavailable to read-only commands. In-process tests need to mirror that composition. AddedBuildConfigurationLikeProgramCshelper. -
Parallel-execution race on
instances.json: when diagnostic tests'registry.Add/Removeran concurrently with register tests, register's pre-created entry got stomped. Fixed viaWindowsTentacleHostStateCollectionserializing all 4 register-touching test classes.
Test plan
-
dotnet buildgreen -
Verified locally on macOS dev box: 14/14 (10 register + 4 diagnostic) green when run together -
CI tentacle-windows-e2e workflow passes all 4 new W-D* tests + existing 88 tests still pass