From ab771ea24e2f42077f0cd319e6387d5b72465fc2 Mon Sep 17 00:00:00 2001 From: Dai Ha Date: Wed, 15 Jul 2026 15:30:20 +0200 Subject: [PATCH] CB-110: cover drop of a delivered-but-unpicked-up turn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the drop test for the delivered/awaitingPickup/!turnObserved state (worker vanished after delivery but before a WORKING sample) — a gap the other two drop tests missed. Surfaced by an off-sub worker's code review of CB-110, delegated through the bridge itself. --- .../java/dev/ltms/bridged/inject/InjectorTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bridged/src/test/java/dev/ltms/bridged/inject/InjectorTest.java b/bridged/src/test/java/dev/ltms/bridged/inject/InjectorTest.java index 6dad04d..07c0815 100644 --- a/bridged/src/test/java/dev/ltms/bridged/inject/InjectorTest.java +++ b/bridged/src/test/java/dev/ltms/bridged/inject/InjectorTest.java @@ -253,6 +253,20 @@ class InjectorTest { assertEquals(List.of(T), cap.failed, "a worker that vanishes mid-turn fails its in-flight send"); } + @Test + void dropFailsADeliveredTurnThatVanishesBeforePickupIsConfirmed() { + // Delivered but no WORKING sampled yet (awaitingCompletion=true, awaitingPickup still true, + // turnObserved=false) — a distinct state the other two drop tests don't cover. (Gap surfaced + // by an off-sub worker's review of CB-110, delegated through the bridge.) + Captor cap = new Captor(); + Injector inj = new Injector(new AgentControl(herdr), cap); + inj.enqueue(T, "task"); + inj.onStatus(T, AgentStatus.IDLE); // deliver; pickup never confirmed + + inj.drop(T, new HerdrException("worker gone", "pane_not_found", null)); + assertEquals(List.of(T), cap.failed, "a delivery that vanishes before pickup still fails its send"); + } + @Test void pollerDeliversToAnIdleWorker() throws Exception { // End-to-end through the poller: idle worker → message delivered without manual onStatus.