From 8dd7ed7da358134e16131427219245a579266e18 Mon Sep 17 00:00:00 2001 From: Andrei Hasna Date: Wed, 5 Aug 2026 04:13:03 +0300 Subject: [PATCH] test(send): pin that the authoritative read-back carries no degradation marker Remediation cycle 2, one finding from the scoped re-review. `sendMessage` has TWO authoritative return paths -- the create-echo when the server honours the caller UUID, and the by-uuid read-back. Only the first was guarded against a stray `write_confirmation`. The read-back test asserted with `toMatchObject`, a SUBSET match, which would silently accept an extra key. No live defect: the read-back path returns the row unflagged today. The gap is forward-looking -- a future regression marking a genuine read-back as degraded would ship undetected, corrupting the exact signal the field exists to provide. Verified the assertion can fail rather than assuming it: forcing `degraded: true` onto the read-back path yields 34 pass / 1 fail, and restoring returns 35 pass / 0 fail. Refs: todos d8f3f963 Agent: Silvanus --- src/lib/store/api-store.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/store/api-store.test.ts b/src/lib/store/api-store.test.ts index c1d3f7c..f64d8a9 100644 --- a/src/lib/store/api-store.test.ts +++ b/src/lib/store/api-store.test.ts @@ -290,6 +290,13 @@ describe("ApiStore.sendMessage wire body", () => { }); expect(message).toMatchObject({ id: 649560, uuid: exactUuid, channel: "git-publishing" }); + // The by-uuid read-back is the AUTHORITATIVE path, so it must carry no + // degradation marker. `toMatchObject` above is a subset match and would + // silently accept a stray one, which would corrupt the exact signal the + // field exists to provide — and `sendMessage` has two authoritative returns + // (create-echo and this read-back), of which the other one was already + // covered and this one was not. + expect((message as unknown as { write_confirmation?: unknown }).write_confirmation).toBeUndefined(); }); // ── regression: rc=1 on a write that fully succeeded (todos d8f3f963) ────────