Send incremental worker views with direction and tracked job state

Borrow the provider tracker queries from cecb1e9. Keep unavailable state unknown, bind incremental views to acknowledged source entries, reset after compaction, bound serialized payloads, and recheck tracked work at sign-off.
This commit is contained in:
wassname
2026-09-08 16:41:47 +08:00
parent 489298d58b
commit 47cc054582
13 changed files with 305 additions and 31 deletions
+11
View File
@@ -52,6 +52,17 @@ describe("pi-intercom transport", () => {
expect(resumed.fixture.sent.filter(message => message.kind === "steer")).toHaveLength(1);
});
it("advances the incremental overview only after acknowledgment", async () => {
const runtime = setup("worker");
await runtime.link.waitReady();
const view = runtime.link.view("The worker stopped.", "settled", "entry-1", true);
expect(runtime.link.acknowledgedEntry).toBeUndefined();
runtime.fixture.receive({ binding: "binding", role: "supervisor", kind: "received", id: view.id });
expect(runtime.link.acknowledgedEntry).toBe("entry-1");
const resumed = setup("worker", [...runtime.entries]);
expect(resumed.link.acknowledgedEntry).toBe("entry-1");
});
it("cancels a readiness wait on shutdown", async () => {
const runtime = setup("worker");
await runtime.link.waitReady();