File Search: files-worker (async sync, scans, pauses) (ee)
Part of #1379.
A separate process (files-worker, same image, no HTTP server for the public) that schedules syncs with Postgres leases (FOR UPDATE SKIP LOCKED), walks the source, downloads only new or changed files, skips identical content by SHA-256, sends files to the extractor and writes chunks; per-org fairness (slices), back-pressure when Postgres or MCP latency is high, container limits. Setup scans (listing-only dry run + 20 samples + suggestions), description drafts (AI via the existing LLM client when KG_LLM_ENABLED, rule-based otherwise), quota check after the walk with paused_quota, paused_licence, daily recheck and auto-resume. Internal endpoints /internal/test, /internal/fetch.
The backend that answers MCP never connects to a customer's server and never runs a sync.
The worker, leases, workspace fairness, scans, delta sync and pause/resume paths shipped in #1395. The existing scheduler, worker, chunking and description tests pass locally (20/20). One item still looks open: back-pressure checks active Postgres sessions (FILES_PG_ACTIVE_MAX), but does not consume MCP latency. Leaving this open for that requirement to be implemented or explicitly deferred.
Thanks for checking. Let's defer the MCP latency part of back-pressure: FILES_PG_ACTIVE_MAX covers what we need today, and we have not seen the files-worker slow down MCP calls. I am closing this issue because the rest shipped in #1395. We will open a new one if latency data shows the need.