Skip to content

Stop announcing an incremental scan the server will refuse - #169

Draft
Ibrahimrahhal wants to merge 1 commit into
mainfrom
cursor/stop-announcing-refused-incremental-diffs-9f4e
Draft

Stop announcing an incremental scan the server will refuse#169
Ibrahimrahhal wants to merge 1 commit into
mainfrom
cursor/stop-announcing-refused-incremental-diffs-9f4e

Conversation

@Ibrahimrahhal

Copy link
Copy Markdown
Member

What

The CLI carries a 5000-path payload guard and lets the server apply the real ceiling. That division is right and stays: INCREMENTAL_SCAN_MAX_FILES is a server setting a deployment can raise, and no API reports it, so refusing locally would lose incremental scans that would have worked.

What was wrong is what the run said about it. The server refuses a changed-file list of 300 or more (>=, not >), so a branch a few hundred files' worth of changes away from trunk was told

Incremental scan: 412 files changed since commit abc1234.

and then had every file analyzed, with nothing in the output to suggest otherwise.

Change

Past the server's default ceiling, say what is likely to happen and how to change it:

412 files changed since commit abc1234, at or past the 300 an incremental scan covers
by default, so Corgea will most likely analyze every file. Scanning from a more recent
commit narrows the diff.

Below the ceiling the message is unchanged. The wording is hedged because the ceiling is a server setting this run cannot read — a deployment that raised it will scan incrementally after all, and none of this is worth refusing over.

The message moved into describe_plan so the boundary is testable without an API.

Testing

./harness check passes: 815 tests, clippy strict, format. Two new unit tests cover the boundary (299 announces, 300 does not) and that a worktree-covering diff still says so.

Open in Web Open in Cursor 

The CLI carries a 5000-path payload guard and lets the server apply the
real ceiling, which is right -- INCREMENTAL_SCAN_MAX_FILES is a server
setting a deployment can raise and no API reports it, so refusing locally
would lose incremental scans that would have worked.

What was wrong is what the run said about it. The server refuses a list of
300 or more, so a branch 400 commits' worth of changes away from trunk was
told "Incremental scan: 412 files changed since commit abc1234" and then
analyzed every file. Past the default ceiling, say that Corgea will most
likely scan everything and how to narrow the diff, and leave the promise
for the counts that can keep it.

Extracted into describe_plan so the boundary is testable without an API.

Co-authored-by: ibrahim <ibrahim@corgea.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants