Fix: UpsertOutcome newtype serde panic (silent since Phase 26) #2
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/upsert-outcome-serde"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surfaced by
The auditor's hybrid fixture on branch
auditor/scaffold(PR #1) exercised/vectors/playbook_memory/seed against the live gateway on 2026-04-22. Layer 3
of that fixture reported "empty socket close" and the gateway logs showed:
Silent from commit
640db8c(Phase 26 Mem0 upsert, 2026-04-21) until now.No unit test or scenario caught it because all coverage was on the enum's
pattern-match side — nobody serialized it live against the gateway until
the auditor fixture did.
Root cause
#[serde(tag = "mode")]requires struct-like variants. BareAdded(String)andNoop(String)newtype variants have nowhere to placethe string under the tag pattern.
Fix
Convert both to struct-like:
Added { playbook_id: String }andNoop { playbook_id: String }. Updates 7 construction + pattern-matchsites. Wire JSON format is now uniform across all three variants.
Live verification (after gateway restart)
Tests
51/51 vectord lib tests green. Release build clean.
Merge order
Merge this PR first. Then PR #1 (
auditor/scaffold) layer 3 flips greenwhen rebased/retested — the auditor is self-correcting once it catches
an issue that gets fixed on a separate branch.
🤖 Generated with Claude Code
playbook_memory.rs:257 — UpsertOutcome had two newtype variants carrying a bare String: Added(String) Noop(String) under #[serde(tag = "mode")]. serde cannot tag newtype variants of primitive types, so every serialization threw: "cannot serialize tagged newtype variant UpsertOutcome::Added containing a string" This caused gateway /vectors/playbook_memory/seed to panic the tokio worker on EVERY call that reached Added or Noop, returning an empty socket close to the client. The bug was silent from commit 640db8c (Phase 26, 2026-04-21) until 2026-04-22 when the auditor's hybrid fixture (auditor/fixtures/hybrid_38_40_45.ts on the auditor/scaffold branch) exercised the endpoint live and gateway logs showed the panic. Fix — convert both newtype variants to struct-like: Added { playbook_id: String } Noop { playbook_id: String } Updated all 7 construction + pattern-match sites. Updated rustdoc on the enum explaining why the shape is what it is. JSON wire format is now uniform across all three variants: {"mode":"added","playbook_id":"pb-..."} {"mode":"updated","playbook_id":"pb-...","merged_names":[...]} {"mode":"noop","playbook_id":"pb-..."} Verified live after gateway restart: curl /seed new payload → mode=added, playbook 860231f5 curl /seed new payload + doc_refs → mode=added, playbook 11d348d9 curl /seed identical re-submit → mode=noop, same id 860231f5, entries_after unchanged (Mem0 contract intact) Tests: 51/51 vectord lib tests green. Release build clean. This is a follow-up bug fix landed in its own branch (fix/upsert-outcome-serde) rather than commingled with other work. The auditor's hybrid fixture on the auditor/scaffold branch will now light up layer 3 (phase45_seed_with_doc_refs) as a pass once this merges — previously it failed here with an empty socket close.Auditor verdict: 🛑
blockOne-liner: 1 blocking issue: cloud: claim not backed — "Verified live after gateway restart:"
Head SHA:
f0a3ed68321dAudited at: 2026-04-22T09:00:53.827Z
dynamic — 1 findings (0 block, 0 warn, 1 info)
ℹ️ info — dynamic check skipped — skipped by options
skipped by optionsinference — 7 findings (1 block, 5 warn, 1 info)
ℹ️ info — cloud review completed (model=gpt-oss:120b, tokens=2783)
claim_verdicts: 6, unflagged_gaps: 0⚠️ warn — cloud: claim not backed — "51/51 vectord lib tests green. Release build clean."
at pr_body:39cloud reason: Claim asserts test suite status; diff only shows code changes, no evidence of CI results.⚠️ warn — cloud: claim not backed — "Merge this PR first. Then PR #1 (
auditor/scaffold) layer 3 flips green"at pr_body:43cloud reason: Procedural merge instruction, not implemented in code.⚠️ warn — cloud: claim not backed — "an issue that gets fixed on a separate branch."
at pr_body:45cloud reason: Statement about separate branch fix; no code present.🛑 block — cloud: claim not backed — "Verified live after gateway restart:"
at commit:f0a3ed68:30cloud reason: Runtime verification after gateway restart not represented in diff.⚠️ warn — cloud: claim not backed — "Tests: 51/51 vectord lib tests green. Release build clean."
at commit:f0a3ed68:37cloud reason: Repeats test‑green claim; diff provides no proof of CI outcome.⚠️ warn — cloud: claim not backed — "This is a follow-up bug fix landed in its own branch"
at commit:f0a3ed68:39cloud reason: General bug‑fix statement without concrete code evidence.kb_query — 1 findings (0 block, 0 warn, 1 info)
ℹ️ info — KB: 69 recent scenario runs, 209/289 events ok (fail rate 27.7%)
most recent: scenario-2026-04-21T05-29-34recent failing sigs: 5745bcd5e4c68591, 5745bcd5e4c68591, caeeeffc69d36009Metrics
Lakehouse auditor · SHA
f0a3ed68· re-audit on new commit flips the status automatically.