Problem
pallets/flask's src/flask/__init__.py is 2 KB of plain re-exports (from .app import Flask as Flask, ×60). It is parsed, then removed from the scan output:
[GalaxyScope.statistical_auditor] [python] Excluded: '__init__.py' stripped to unparsable.
Reason: Packed Payload Guard (Impossible Density: 3.95 hits/line)
It is absent from file_data, so:
- no import edge can land on it: every
from flask import X and from . import X inside the package loses its target;
- anything that asks "is this directory a package" from the scanned files reads
src/flask/ as a source root. import_graph_accuracy.py's ground truth does this, so it expects import typing in blueprints.py, cli.py, config.py … to resolve to src/flask/typing.py. Those ~7 Python "misses" are artifacts of the dropped file.
Why it trips
A re-export barrel has several signal hits on every line (import, the as alias, named tokens), so hits per line sits near 4. That's the same density profile the guard uses to spot minified or packed payloads, but this file is ordinary, human-written code.
Repro
cd <checkout of pallets/flask>
GITGALAXY_DISABLE_GIT_HISTORY=1 python -m gitgalaxy.galaxyscope . --db-only --debug --output /tmp/o.json
grep "Packed Payload Guard" <log>
sqlite3 /tmp/*_master.db "select count(*) from file_data where file_path='src/flask/__init__.py'" # 0
Fix direction
Exempt a file whose lines are overwhelmingly import/re-export statements from the density guard. Short, one-statement-per-line barrels are the opposite of a packed payload, which is long lines with few newlines. Or base the guard on line length or entropy rather than hits per line alone. Measure the effect with tests/tools/import_graph_accuracy.py python.
Found while working on import-graph precision (the Python from . import name fix).
Problem
pallets/flask'ssrc/flask/__init__.pyis 2 KB of plain re-exports (from .app import Flask as Flask, ×60). It is parsed, then removed from the scan output:It is absent from
file_data, so:from flask import Xandfrom . import Xinside the package loses its target;src/flask/as a source root.import_graph_accuracy.py's ground truth does this, so it expectsimport typinginblueprints.py,cli.py,config.py… to resolve tosrc/flask/typing.py. Those ~7 Python "misses" are artifacts of the dropped file.Why it trips
A re-export barrel has several signal hits on every line (import, the
asalias, named tokens), so hits per line sits near 4. That's the same density profile the guard uses to spot minified or packed payloads, but this file is ordinary, human-written code.Repro
Fix direction
Exempt a file whose lines are overwhelmingly import/re-export statements from the density guard. Short, one-statement-per-line barrels are the opposite of a packed payload, which is long lines with few newlines. Or base the guard on line length or entropy rather than hits per line alone. Measure the effect with
tests/tools/import_graph_accuracy.py python.Found while working on import-graph precision (the Python
from . import namefix).