Skip to content

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

Closed

Description

@squid-protocol

What

A delta scan (galaxyscope --incremental <baseline.db>, used by tests/tools/self_scan.py when a baseline exists, and the "Continuous Delta" CI/CD mode) silently drops files that a full scan of the same commit indexes.

Reproduction (2026-10-05)

  • Baseline: self-scan DB of 745c4ffa4 (full scan: 1,292 files).
  • HEAD 8deb03328 (19 files changed since the baseline). self_scan.py runs the incremental scan (8.0s) → 1,193 files, 13,268 functions, 546 classes.
  • A full scan of the same HEAD (DB moved aside) → 1,295 files, 13,616 functions, 631 classes.
  • 102 files missing from the delta result (far more than the 19 changed files, so unchanged files are being lost). By directory: gitgalaxy/standards 44 (e.g. gitgalaxy_config.py, language_standards/languages/abap.py, assembly.py, bms.py), tests/cobol_mainframe 18, .github/workflows 15, tests/core_engine 7, others.

Why it matters

Delta mode is offered for CI/CD, so incomplete results are returned with no warning. "Same code, same answer" means a delta scan must equal a full scan of the same commit.

Do

  • Find where unchanged files are lost (the rehydrated baseline set, or how the delta's file list is merged: state_rehydrator.py, the delta path in galaxyscope.py ~L3599).
  • Add a regression test: delta scan == full scan (same file, function and class sets) after a small change.
  • Consider a CI check comparing delta vs full on the repo itself, and make self_scan.py verify counts against the baseline.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    data-integrity
    core-engine
    priority: high
    on Oct 5, 2026
  2. squid-protocol commented on Oct 5, 2026

    @squid-protocol
    OwnerAuthor

    Triage notes (2026-10-05), to save the fixer time:

    • Not a committed-vs-uncommitted effect: all 102 missing files are tracked and committed, none changed between the baseline (745c4ff) and HEAD, and the worktree had no uncommitted changes.
    • Not a 'files with no functions' effect: only 48 of the 102 have zero functions, and 245 zero-function files survive the delta.
    • Where to look: delta (galaxyscope.py ~L3599) rebuilds the census only from the rehydrated ram_cache (step 2), so any file StateRehydrator.load_state fails to restore vanishes. Diff the rehydrated key set against the baseline's file_data rows.
    • Separate thing to verify (owner's question): if changed files come from git diff baseline..HEAD only, uncommitted working-tree edits are never re-scanned, which would give an agent mid-edit stale results. Check, and either include working-tree changes or document that the delta needs a commit.
  3. added
    scope:infra
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginedata-integritypriority: highscope:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions