Audit deployment timeouts as DeploymentTimedOut, not DeploymentFailed
Summary
- A wall-clock deployment timeout now pauses the deployment and preserves its checkpoint for resume (shipped in the resumable-timeout change). Recording its audit event as
DeploymentFailedmisrepresented this recoverable outcome, so a timed-out deployment showed up in the audit feed as a failure. - Adds
EventCategory.DeploymentTimedOut = 19and repointsDeploymentAuditEventHandler.OnDeploymentTimedOutAsyncto it, so the audit feed distinguishes a timeout (paused/resumable) from a genuine failure.
Why it's non-breaking
-
19is additive — no existing value (1–18) is renumbered, andEventCategorystaysshort-backed. Theevent.categorycolumn is a plainsmallintwith no CHECK constraint / enum type, so no migration is needed. - The new
EventCategoryRegistrydescriptor is mandatory, not optional: the read path (EventService.ToDto→EventCategoryRegistry.Describe) throws on an unmapped category, and theEveryEventCategory_HasANonEmptyDescriptordrift test enforces it. Both are satisfied by the added descriptor. - No
switch/exhaustive match overEventCategoryanywhere insrc/lacks a default. The handler diff is surgical — onlyOnDeploymentTimedOutAsyncchanged;OnDeploymentFailedAsyncand the other 8 mappings are untouched.
Pairs with
The resumable-timeout change (separate PR on this milestone) is what makes a timeout paused/resumable. This PR is independently correct — the DeploymentTimedOutEvent is emitted on timeout regardless — and the two together make task state and audit category fully consistent.
Test plan
-
Unit: EventCategoryRegistryTests— display-nameInlineData+19numbering pin;DeploymentAuditEventFactoryTests— passthroughInlineData. (23/23) -
Integration (real Postgres): DeploymentAuditEventHandlerTests.TimedOutEvent_IsAuditedAsDeploymentTimedOutasserts the timeout recordsDeploymentTimedOut;FailedEvent_PersistsDeploymentFailedretained as the contrast proving genuine failures are unaffected. (7/7) -
dotnet build src/Squid.Core— 0 errors. -
Adversarial review (independent agent): ship, no blocking issues.
Follow-up (frontend, separate repo)
SquidWeb feat/deployment-timedout-event-tone tones the new category as warning (orange) — opened alongside.