Repository navigation
Send doghouse the reason a scan is not incremental - #185
Ibrahimrahhal wants to merge 3 commits into
Conversation
Every way a blast upload ends up analyzing every file now carries a stable cause code and the sentence the run printed, as incremental_skipped_reason and incremental_skipped_detail. That includes --disable-incremental and --target/--only-uncommitted, which never reach the baseline lookup. Co-authored-by: ibrahim <ibrahim@corgea.com>
Only the planner's refusals are printed; the two flags were the user's own choice. Doc comments now describe what the code does. Co-authored-by: ibrahim <ibrahim@corgea.com>
A baseline whose stored checksums cannot be downloaded, decoded, or are an unknown version is why a diff that should have worked did not, so it outranks git's refusal as the cause sent to the server. Pins every cause code the server stores. Co-authored-by: ibrahim <ibrahim@corgea.com>
corgea-security
left a comment
There was a problem hiding this comment.
Automated review risk: 2/5.
No actionable critical, high, or nitpick findings are supported by the supplied diff. The new full-scan reason propagation is internally consistent and covered by focused unit and end-to-end tests.
No critical or high-priority changes were found.
corgea-security
left a comment
There was a problem hiding this comment.
Approved by Dennis: high policy risk and automated risk 2/5.
There was a problem hiding this comment.
No merge blockers on bd3a7bc.
The upload stays reason XOR diff. upload_zip sends incremental_skipped_reason and incremental_skipped_detail only on Err, and the base/changed-file fields only on Ok, on every chunk including the final one. --disable-incremental on a clean tree still sends dirty=false with disabled_by_flag. --target, --only-uncommitted, and --exclude still force dirty=true.
A missing manifest leaves git's cause (exclude_needs_checksums, dirty_worktree). Unreadable checksums become baseline_checksums_unreadable only when git also refuses; a git fallback that succeeds still uploads a diff and neither skip field. Flag refusals stay silent. Every other refusal is still Scanning every file: {detail}., and the clauses match the previous strings. All 13 codes match [a-z0-9_]{1,64}. No earlier review threads on this PR.
Sent by Cursor Automation: pr-flow


Why
When
corgea scan blastanalyzes every file, it prints why ("Scanning every file: ..."), but the server never hears about it. So a full scan that someone expected to be incremental can't be explained once the terminal output is gone.Change
FullScanReason: a stable cause code plus the sentence the run already prints. That includes--disable-incrementaland--target/--only-uncommitted, which never reach the baseline lookup and are still silent in the terminal.upload_zipsends these asincremental_skipped_reasonandincremental_skipped_detailwhenever it sends no diff fields. Doghouse stores them in the scan's internalmeta_infoand treatsdisabled_by_flagas an opt-out of its own SCM-integration diff (Corgea/doghouse#2311).disabled_by_flag,targeted_upload,no_baseline_scan,baseline_lookup_failed,baseline_checksums_unreadable,exclude_needs_checksums,dirty_worktree,no_git_commit,baseline_has_no_commit,baseline_commit_not_in_clone,git_diff_failed,submodule_moved,too_many_changed_files. They are a wire contract: new ones can be added, but shipped ones must not be renamed. A unit test pins them.baseline_checksums_unreadable. That fault is why a diff that should have worked did not.Err(String)refusals inincremental.rsbecameFullScanReason, andUploadOptions.incrementalis nowResult<IncrementalPlan, FullScanReason>, so no full-scan path can leave out its reason. The "Scanning every file" line is now printed in one place inblast.rs. Terminal output is unchanged.Known limitation
On a dirty or
--excluderun, the baseline lookup skips baselines that have a commit but no checksums. If those were the only candidates, the run reportsno_baseline_scan. That message logic predates this change and is left alone here.Tests
./harness check: clippy (strict), fmt, and 954 tests passed.tests/cloud_commands_e2e/scan_incremental.rsnow check the reason fields for these cases: no baseline, a failed lookup,--disable-incremental,--target,--excludewithout checksums, a dirty tree without checksums, and a dirty tree with unreadable checksums. They also check that incremental uploads (checksum diff and git diff) send neither field.Deploy notes
None. Older servers ignore the extra fields. No version bump is included.