From 2433e726e35232b5b380b22b6d2fdbf40fbe7c42 Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Wed, 12 Aug 2026 18:43:15 -0700 Subject: [PATCH] Project Fastmail source readiness. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Register the live producer control lane on every poll so the inspector distinguishes configured email ingress from historical event residue. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code --- src/connectors/fastmail-jmap.ts | 16 ++++++++++++++++ test/fastmail-jmap.test.ts | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/connectors/fastmail-jmap.ts b/src/connectors/fastmail-jmap.ts index 15d0cdc..df4cba9 100644 --- a/src/connectors/fastmail-jmap.ts +++ b/src/connectors/fastmail-jmap.ts @@ -468,6 +468,22 @@ export class FastmailJmapConnector { const prior = await store.getSourceCursor(cursorId); const correlationId = newId("fastmail_jmap_poll"); const startedAt = new Date().toISOString(); + await store.registerSource({ + id: this.id, + kind: this.kind, + enabled: true, + config: { + ...this.describe(), + control: { + version: 1, + kind: "fastmail-jmap", + enabled: true, + lane: "mail-ingress", + runtime: { state: "ready", readyAt: startedAt, revision: CURSOR_REVISION }, + }, + }, + updatedAt: startedAt, + }); await store.appendEvent(connectorEvent(this.id, "started", correlationId, startedAt, { status: "started", transport: "authenticated-jmap-poll", diff --git a/test/fastmail-jmap.test.ts b/test/fastmail-jmap.test.ts index 6ce06e8..39ac10b 100644 --- a/test/fastmail-jmap.test.ts +++ b/test/fastmail-jmap.test.ts @@ -8,6 +8,7 @@ import { } from "../src/connectors/fastmail-jmap.js"; import type { JazzThoughtStore } from "../src/jazz/store.js"; import { rebuildRootActivity } from "../src/projections/activity.js"; +import { buildSourceHealth } from "../src/projections/source-health.js"; import { temporaryProject, testStore } from "./helpers.js"; const stores: JazzThoughtStore[] = []; @@ -35,6 +36,15 @@ describe("live Fastmail JMAP polling", () => { destroyed: 0, }); expect(await fixture.store.listEvents({ types: ["stream.thought.source.email.observed"] })).toEqual([]); + expect((await buildSourceHealth(fixture.store)).find((source) => source.source === "fastmail:fixture")).toMatchObject({ + kind: "fastmail", + enabled: true, + configured: true, + control: { + lane: "mail-ingress", + runtime: { state: "ready", revision: "fastmail-jmap-v1", current: true }, + }, + }); expect((await fixture.store.getSourceCursor("cursor:fastmail:fixture"))?.cursor).toEqual({ revision: "fastmail-jmap-v1", accountIdHash: expect.stringMatching(/^[a-f0-9]{64}$/), -- 2.51.2