Repository navigation
fix: a delta scan keeps unchanged files a full scan indexes (#4483) - #4484
Merged
Merged
Conversation
Unchanged files under SARIF_IGNORED_PATHS are persisted with zeroed signal counts (sanitised after the audit); the delta's statistical auditor re-judged that zero-signal row as a data dump and dropped it (99 of 1,295 files on the self-scan). A rehydrated file already passed the baseline audit, so the auditor now passes it through. Changed files go through the aperture filter like a full scan's census; untracked files get a loud warning (a full scan skips them too). self_scan.py checks the delta's file count against the baseline and falls back to a full scan. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
galaxyscope --incremental <baseline.db>silently dropped unchanged files a full scan of the same commit indexes. Repro on the self-scan (baseline = HEAD~15, 1,281 files): full scan 1,295 files / 13,470 functions / 622 classes; delta 1,196 files, 99 missing (gitgalaxy/standards, tests/cobol_mainframe, .github/workflows, ...). The rehydrator restored all 1,281 baseline files; they were lost afterwards.Fix
Phase 10.5 of a full scan zeroes the hit/risk vectors of files under
SARIF_IGNORED_PATHSafter the audit, so the DB stores them with zero signals. The delta'sStatisticalAuditorre-judged that row, read "LOC > 50, signals 0" as a data dump and relegated it (Zero-Density Threshold). A rehydrated file already survived the baseline audit, so it now carriesrehydrated: Trueand the auditor passes it through (it still joins the density baseline when it has signal). Also in the delta: changed files go through the aperture filter like the full scan's census, and git type changes (T) are rescanned.Uncommitted edits: yes, they are re-scanned. The delta uses
git diff --name-status <baseline>, which compares the working tree, so staged and unstaged edits to tracked files andgit added new files are included. Untracked files are not, deliberately: a full scan's census isgit ls-files, which never lists them, so scanning them would break delta == full. The delta now logs a loud warning naming them (git addto include). Covered by the test.Before -> after
Delta vs full of the same HEAD: files 1,196 vs 1,295 -> 1,295 vs 1,295; functions 13,142 vs 13,470 -> equal; classes 537 vs 622 -> equal. Delta 8-9s vs full ~18s.
tests/core_engine/test_delta_equals_full_4483.py(temp git repo: unchanged, modified, deleted, unstaged edit, staged new, untracked, denied-extension file, an unchanged zero-signal file under an ignored path) fails on main, passes now.tests/tools/self_scan.pynow checks the delta's file count against baseline minus deleted/renamed and falls back to a full scan with a warning (verified by running it against the unfixed engine).Golden masters / ratchets
Golden masters: not moved by construction (only rehydrated artifacts and delta code paths changed; full scans are untouched); not re-blessed.
pr_gates.py --ratchets: estate, fact-crosscheck, completeness, ground-truth PASS; ports SKIP (no cics-crucible checkout here). ruff/mypy/dead-key audits clean.Closes #4483
🤖 Generated with Claude Code
https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz