Skip to content

fix: a delta scan keeps unchanged files a full scan indexes (#4483) - #4484

Merged
squid-protocol merged 1 commit into
mainfrom
fix/4483-delta-scan-drops-files
Oct 5, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/4483-delta-scan-drops-files

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

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_PATHS after the audit, so the DB stores them with zero signals. The delta's StatisticalAuditor re-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 carries rehydrated: True and 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 and git added new files are included. Untracked files are not, deliberately: a full scan's census is git ls-files, which never lists them, so scanning them would break delta == full. The delta now logs a loud warning naming them (git add to 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.py now 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

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
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 17:10
@squid-protocol
squid-protocol merged commit e39a1fa into main Oct 5, 2026
36 checks passed
@squid-protocol
squid-protocol deleted the fix/4483-delta-scan-drops-files branch October 5, 2026 17:11
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.

Delta scan (--incremental) silently drops files: 1,193 vs 1,295 for the same commit (102 missing, e.g. gitgalaxy/standards, workflows)

1 participant