From 45f85df8f4f29e8d60bf5392004a7c9fda0555b2 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 23 Jul 2026 12:02:36 -0700 Subject: [PATCH] Revert "fix(webhook): extract links for incremental push syncs (#2850)" This reverts commit 11659743a2605f1dc16a582989614bda24e690a8. --- src/commands/serve-http.ts | 7 ++----- src/commands/sync.ts | 1 - test/sources-webhook.test.ts | 23 ----------------------- test/sync-trigger-cli.test.ts | 1 - 4 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/commands/serve-http.ts b/src/commands/serve-http.ts index 3a6c3fc7c..9b01a183f 100644 --- a/src/commands/serve-http.ts +++ b/src/commands/serve-http.ts @@ -2161,10 +2161,8 @@ export async function runServeHttp(engine: BrainEngine, options: ServeHttpOption // Other event types (ping, pull_request, etc.) return 202 'ignored' // so GitHub doesn't retry. // D15.5: HMAC compare uses the shared safeHexEqual helper. - // D18: submits 'sync' job with extraction + auto_embed_backfill enabled and - // priority -10 (above autopilot's 0). This opts normal incremental pushes - // into sync's inline extraction while pagesAffected still identifies the - // changed pages. The sync core can still defer large (>100) changes. + // D18: submits 'sync' job with auto_embed_backfill=true and priority -10 + // (above autopilot's 0). // --------------------------------------------------------------------------- const githubWebhookLimiter = rateLimit({ windowMs: 60_000, @@ -2284,7 +2282,6 @@ export async function runServeHttp(engine: BrainEngine, options: ServeHttpOption 'sync', { sourceId: source.id, - noExtract: false, auto_embed_backfill: true, embed_reason: 'webhook', }, diff --git a/src/commands/sync.ts b/src/commands/sync.ts index 4a5632c84..84f47488d 100644 --- a/src/commands/sync.ts +++ b/src/commands/sync.ts @@ -1379,7 +1379,6 @@ See also: { sourceId: sourceIdArg, repoPath: source.local_path, - noExtract: false, auto_embed_backfill: true, embed_reason: 'sync_trigger', }, diff --git a/test/sources-webhook.test.ts b/test/sources-webhook.test.ts index e8fd75b40..fdda0ece9 100644 --- a/test/sources-webhook.test.ts +++ b/test/sources-webhook.test.ts @@ -16,7 +16,6 @@ */ import { describe, test, expect } from 'bun:test'; import { createHmac } from 'node:crypto'; -import { readFileSync } from 'node:fs'; import { safeHexEqual } from '../src/core/timing-safe.ts'; const GITHUB_SECRET = 'super-secret-webhook-key'; @@ -124,25 +123,3 @@ describe('Branch ref construction (D5)', () => { expect(pushedRef === `refs/heads/${trackedBranch}`).toBe(false); }); }); - -describe('Webhook sync job extraction contract', () => { - test('opts into extraction before the pushed commit is consumed', () => { - const serveSource = readFileSync( - new URL('../src/commands/serve-http.ts', import.meta.url), - 'utf8', - ); - const routeStart = serveSource.indexOf("'/webhooks/github'"); - const queueStart = serveSource.indexOf('const job = await queue.add(', routeStart); - const responseStart = serveSource.indexOf('res.status(202)', queueStart); - expect(routeStart).toBeGreaterThanOrEqual(0); - expect(queueStart).toBeGreaterThan(routeStart); - expect(responseStart).toBeGreaterThan(queueStart); - - const routeSource = serveSource.slice(queueStart, responseStart); - const payload = routeSource.match( - /queue\.add\(\s*'sync',\s*\{([\s\S]*?)\}\s*,\s*\{/, - ); - expect(payload).not.toBeNull(); - expect(payload?.[1]).toMatch(/\bnoExtract:\s*false\b/); - }); -}); diff --git a/test/sync-trigger-cli.test.ts b/test/sync-trigger-cli.test.ts index 07801b4ea..ff31f7b45 100644 --- a/test/sync-trigger-cli.test.ts +++ b/test/sync-trigger-cli.test.ts @@ -100,7 +100,6 @@ describe('runSyncTrigger', () => { const job = jobs[0]; expect(job.priority).toBe(-10); expect((job.data as { sourceId: string }).sourceId).toBe('default'); - expect((job.data as { noExtract: boolean }).noExtract).toBe(false); expect((job.data as { auto_embed_backfill: boolean }).auto_embed_backfill).toBe(true); });