From cbe3fbea7c17d03eff0d79419cef34c480813abd Mon Sep 17 00:00:00 2001 From: Dotta Date: Wed, 28 Oct 2026 19:01:25 -0500 Subject: [PATCH] style(server): keep GitHub recovery rationale in the audit Remove newly added code comments under CONTRIBUTING.md while preserving the complete non-comment TypeScript token streams and all regression assertions. Co-Authored-By: Paperclip --- ...26-10-25-github-webhook-recovery-sleep-audit.md | 14 ++++++++++++++ .../__tests__/chat-channels.integration.test.ts | 4 ++-- .../chat-channels/github/webhook-ingress.ts | 10 +++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/doc/plans/2026-10-25-github-webhook-recovery-sleep-audit.md b/doc/plans/2026-10-25-github-webhook-recovery-sleep-audit.md index e1e0b562f7d..18a6199ed89 100644 --- a/doc/plans/2026-10-25-github-webhook-recovery-sleep-audit.md +++ b/doc/plans/2026-10-25-github-webhook-recovery-sleep-audit.md @@ -292,3 +292,17 @@ tree identical to the previously validated branch, so already-landed parent changes no longer inflate this PR's diff. Fresh current-head CI and review must evaluate the constraint evidence before this slice can merge; an old conditional verdict or neutral check is not treated as a pass. + + +## Repository comment rule follow-up + +Apply CONTRIBUTING.md's prohibition on new code comments consistently to this +slice too. Seven newly added comment lines are removed: two in the constraint +regression and five explaining GitHub pagination guards. The database-constraint +evidence above and pagination/partial-window rationale in this audit remain the +durable explanation. TypeScript parsing proves both affected files retain the +exact non-comment token stream; no recovery predicate, guard, assertion, deadline +or transport call changes. The 22-case current recovery acceptance and earlier +751-case runtime evidence keep their stated revisions and scope. Fresh head CI +and review are still required; neither an old score nor comment-only equivalence +by itself satisfies the merge gates. diff --git a/server/src/__tests__/chat-channels.integration.test.ts b/server/src/__tests__/chat-channels.integration.test.ts index 80ecc192509..8082ab96048 100644 --- a/server/src/__tests__/chat-channels.integration.test.ts +++ b/server/src/__tests__/chat-channels.integration.test.ts @@ -16150,8 +16150,8 @@ describeEmbeddedPostgres("chat channel control-plane integration", () => { const f = await githubPreIngressRecoveryFixture(); const [endpoint] = await readChatEndpointsById(f.endpoint.id); await f.makeScanDue(); - // Exercise the actual database boundary without disabling constraints or - // inventing a row that supported writers cannot commit. + + const mutation = mode === "null" ? db.execute(sql`update ${chatEndpoints} set assigned_agent_id = null where ${chatEndpoints.id} = ${endpoint.id}`) : mode === "missing" diff --git a/server/src/services/chat-channels/github/webhook-ingress.ts b/server/src/services/chat-channels/github/webhook-ingress.ts index 4e04a4a2b31..e186b468a9a 100644 --- a/server/src/services/chat-channels/github/webhook-ingress.ts +++ b/server/src/services/chat-channels/github/webhook-ingress.ts @@ -1252,9 +1252,9 @@ export function createGitHubWebhookIngress(db: Db, options: GitHubWebhookIngress appToken, cursor, }); - // GitHub's official recovery recipe uses newest-first pagination - // and stops at the age floor. Reject observed ordering drift rather - // than assuming unseen pages cannot contain a successful sibling. + + + for (const attempt of result.deliveries) { const timestamp = Date.parse(attempt.deliveredAt); if (timestamp > previousTimestamp) @@ -1269,8 +1269,8 @@ export function createGitHubWebhookIngress(db: Db, options: GitHubWebhookIngress cursor = result.nextCursor; truncated = page === 2; } - // All pages in this time window are needed to rule out a successful - // sibling; do not act on a partial window after hitting the work cap. + + if (truncated) { outcome = "history_limit_reached"; nextDelay = 5 * 60_000;