Skip to content

fix: don't publish an impossible max temperature - #47

Merged
pineappledr merged 1 commit into
mainfrom
summary-temp-sanity
Sep 2, 2026
Merged

fix: don't publish an impossible max temperature#47
pineappledr merged 1 commit into
mainfrom
summary-temp-sanity

Conversation

@pineappledr

Copy link
Copy Markdown
Owner

Lo que pasó

/api/summary sirvió esto en su primer día en producción:

"max_temp_c": 27058405379

Mientras tanto, la flota real:

46 °C | Brain     | Samsung SSD 970 EVO
41 °C | Veronica  | SanDisk SD9SB8W-25
40 °C | Veronica  | GOFATOO 512GB SSD

El valor corrupto viene de una fila de temperature_history, no de este handler. Pero un dashboard que pinta ese número miente con aplomo, así que el endpoint deja de repetirlo.

El fix

Acota a un rango físicamente posible (0 < t <= 120 °C — los discos se apagan solos mucho antes). Fuera de rango reporta 0, que el widget muestra como "sin dato" en vez de una lectura inventada.

Lo que NO arregla

La fila corrupta sigue ahí. Eso pertenece a la ruta de ingesta de temperatura y merece su propio análisis. Esto sólo impide que la corrupción llegue a una pantalla en la que alguien confía.

Nota sobre los 13 discos "críticos"

Al revisar esto comprobé el otro dato que parecía sospechoso: los critical: 13 son correctos — coinciden exactamente con lo que devuelve /api/smart/health/all autenticado. No es un bug del resumen.

go test ./...  13 paquetes, 0 fallos

🤖 Generated with Claude Code

/api/summary served max_temp_c 27058405379 on its first day in
production, while no drive in the fleet was above 46 °C. The bad value
comes from a row in temperature_history, not from this handler — but a
dashboard that paints that number lies with confidence, so the endpoint
stops repeating it.

Clamps to a physically possible range (0 < t <= 120 °C; drives shut
themselves down long before that). Out of range reports 0, which the
widget renders as "no data" instead of a fabricated reading.

This does NOT fix the corrupt row — that belongs in the temperature
ingest path and needs its own look. It stops the corruption from
reaching a screen someone trusts.

  go test ./...  13 packages, 0 failures

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

🐳 Preview Images Built!

Image Pull Command
Server docker pull ghcr.io/pineappledr/vigil:pr-47
Agent (Alpine) docker pull ghcr.io/pineappledr/vigil-agent:pr-47
Agent (Debian) docker pull ghcr.io/pineappledr/vigil-agent:pr-47-debian

These preview images can be used for testing before merging.

@pineappledr
pineappledr merged commit 69137c2 into main Sep 2, 2026
16 checks passed
@pineappledr
pineappledr deleted the summary-temp-sanity branch September 2, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant