Show a redelivered container exit once in Logs history, with the OOM kill any copy saw #3152
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.48) × (1 − Review Confidence (0.53)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 525 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 85% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.375
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3152"
general
weight: 0.35
nick-potts
Fixes #3129.
Summary
Logs showed Couldn't load older logs when one history page held the same container exit twice. The dashboard's
collection.insertthrew on the repeated row id, and the page loaded nothing.query.rs).read_exitscollapses the lines that share one exit'stsinto one row, and that row is OOM if any copy says so. Row ids and the format don't change.harvest.rs). This is unchanged from main on purpose. Each settlement still appends, so a failed append is retried on the next replay. A replay can also carry better evidence: the first settle can miss an OOM kill that a later inspect confirms. The first commit moved the append behind "already settled". R1 showed that lost both properties, so it's reverted, and the end-to-end test stays.container-log.collection.ts). It removes in-page repeats, forexits.jsonlfiles that 0.3.1 daemons already wrote, and keeps the "Out of memory" copy.Evidence
Tests. Each failed before its fix.
an_exit_kept_again_shows_once_with_the_oom_kill_any_copy_saw: before,[(10,false),(10,true),(20,…)…]. After, one row per ts, OOM OR-ed.history_shows_an_exit_settled_again_once_with_the_oom_kill_it_learned: settles Unanswered, restarts, replays with an OOM inspect, then reads one page throughquery::page. Before, 2 rows. After, 1 row with OOM.container-log.collection.test.ts: on main,CollectionOperationError: Cannot insert document with ID "server/a/exit/5" because it already exists. After the fix,[exited, killed]keeps "Out of memory (exit code 137)".cargo test -p ployzd --lib observe: 296 passed. Clippy, fmt,pnpm typecheckand lint are clean.Real Server (
SERVERS=1).ployz-observewas restarted.exits.jsonlheld the exit twice, the/api/runtime/logspage repeated its id, and Logs showed "Couldn't load older logs."exits.jsonlstill holds the line twice, by design. The realPOST /api/runtime/logsreturned 85 rows with no repeated id, and web's "Exited with code 137" appears once. Logs load, and searching "Exited" shows it once.OOMKilled=falsefor a real memory-cgroup kill, so the OOM merge is covered only by the unit tests above.Review.
- A page cursor issued before the upgrade can repeat its boundary exit once. The dashboard ignores the repeated id.
- Against an old daemon, copies split across pages keep the first one seen.
Bets
exits.jsonllines, the same history row shape, the same ids.Merge Danger
Door: two-way.
Blast Radius: Logs history. Exits read from
exits.jsonland the Logs page merge. A page cursor from before the upgrade can repeat one exit once.