From 3447973f6f809672a3442cfccc1f410986dfcdce Mon Sep 17 00:00:00 2001 From: Dotta Date: Sun, 25 Oct 2026 12:36:41 -0500 Subject: [PATCH] fix(server): limit native progress work hints to scope identifiers Co-Authored-By: Paperclip --- ...-10-25-native-chat-progress-sleep-audit.md | 25 +++++++++++++++++++ .../chat-native-progress-notifications.ts | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/doc/plans/2026-10-25-native-chat-progress-sleep-audit.md b/doc/plans/2026-10-25-native-chat-progress-sleep-audit.md index 3aeca0a2375..9ead782f720 100644 --- a/doc/plans/2026-10-25-native-chat-progress-sleep-audit.md +++ b/doc/plans/2026-10-25-native-chat-progress-sleep-audit.md @@ -147,3 +147,28 @@ Fetched master is `19ec787e5b` (not replayed into this stack yet). Newly landed #17616 expands native-harness backup expiration to continuity/quarantine evidence and adds its evidence signal. Its interval remains. Preserve that newer contract when migrating its separate retention owner. + +## CI repair: narrow notification payload (2026-10-25) + +CI at `34df8b0d01` failed native status/finalization consumers across server, +chat, Runner, and serialized suites. Local reproduction of the existing +same-run Slack response-recovery test failed before the repair. Its persisted +`native_run_finalizations.failure_detail.message` identified circular JSON +serialization of a Drizzle table through the caller's database handle. + +The new native-progress notifier serialized the entire structurally compatible +scope argument. Existing lifecycle callers legitimately pass wider domain inputs +(including `db`) through that typed boundary. Serialize only `companyId` and +`issueId`, as the lifecycle notifier already does; do not constrain every caller +or serialize domain/private fields into work hints. + +After repair, 15 existing chat finalization/response-recovery/authority cases +passed against external PostgreSQL, all 32 native-progress worker/startup cases +passed, and server typecheck passed. The attempted broader native-finalization +and session-resumption selection failed during local embedded PostgreSQL +initialization (bootstrap exit 1), before tests could run; it is not acceptance +evidence. Fresh CI must verify those native consumers. Before/after logs: +`/tmp/sleep29-finalization-repro.log`, `/tmp/sleep29-finalization-fixed.log`, +`/tmp/sleep29-notification-fix-workers.log`, +`/tmp/sleep29-notification-fix-typecheck.log`, and +`/tmp/sleep29-native-finalization-acceptance.log`. diff --git a/server/src/services/chat-native-progress-notifications.ts b/server/src/services/chat-native-progress-notifications.ts index 742e5284d2d..cc56fd9eac7 100644 --- a/server/src/services/chat-native-progress-notifications.ts +++ b/server/src/services/chat-native-progress-notifications.ts @@ -2,5 +2,5 @@ import { DELIVERY_QUEUES, notifyDeliveryWork } from "./delivery-work-notificatio import type { ChatRunProjectionScope } from "./chat-run-publication-policy.js"; export function notifyChatNativeProgress(tx: object, scope: ChatRunProjectionScope) { - return notifyDeliveryWork(tx, DELIVERY_QUEUES.chatNativeProgress, JSON.stringify(scope)); + return notifyDeliveryWork(tx, DELIVERY_QUEUES.chatNativeProgress, JSON.stringify({ companyId: scope.companyId, issueId: scope.issueId })); }