#4553's panic took the process down because it ran on a goroutine no
recovery covered. Every goroutine on the path now hands a panic back:
- pii's worker calls classify through classifySafely, which recovers,
logs the stack, and returns "the local masking model failed reading
this request (...)" as that request's error. It sets no retry
hold-back, so the next request is tried as usual. Warm in
astrlink.go and serve.go goes through it too.
- guard.Model.Find's per-window workers and bert.go's parallel carry a
panic back to the caller (type carried), and give(procs) is deferred
so a panicking window doesn't keep its cores.
- masking.find's goroutine recovers into the same error.
The gateway's mask calls already run in gwmw.Safely; the pf-serve model
runs in its own process.
Tests: TestGuardPanicFailsOnlyItsRequest (the error, the next request
masks its phone, Now().Failed stays empty), TestParallelCarriesAPanic,
TestFindCarriesAWindowsPanic (real model, a cut word table makes a
window worker panic; the caller sees it and no core is held),
TestModelPanicIsTheRequestsError (masking).
Broken by hand, each red: no classifySafely, the pii test binary
crashes; no recover in masking.find, the masking binary crashes; no
carry in parallel, TestParallelCarriesAPanic fails; no carry in Find,
the guard binary crashes (slice bounds [:5736192] capacity 384); give
not deferred, "3 cores still held after the panic".
Run: as in the stack's first commit (mote: gofmt, vet x3, the pii,
masking and gateway packages at -timeout 45m; Windows: pii, masking,
gateway Embeddings).
Not tried: a panic injected on the CoreML path (macOS, its own
binding); the full ./... suite.
Co-authored-by: SunnyRx <7306148+SunnyRx@users.noreply.github.com>