AST extraction emits source_location=L1 for zero-byte source files (unsatisfiable provenance anchor)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #4086 của @Mpasha17 — đã đóng, không merge
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start with the two-file fixture described in the issue: an empty.py file and witness.py containing VALUE = 1. Run graphify extract ./fixture --out ./out --code-only and inspect the AST extraction output for the zero-byte file. Done means empty.py produces no code node or no source_location, while witness.py retains its valid L1 anchor.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
AST extraction emits a provenance anchor for zero-byte source files:
source_file = empty.py
file_type = code
_origin = ast
source_location = L1
empty.py is 0 bytes / 0 lines, so L1 designates a line that does not exist. The anchor is unsatisfiable by construction: it can neither be resolved nor rejected by reading the file.
Versions tested
| version | behavior |
|---|---|
graphifyy 0.9.72 |
reproduces |
graphifyy 0.9.74 |
reproduces (identical) |
Behavior is identical on both versions — 0.9.74 does not change it.
Minimal fixture
Two files, one of them empty:
fixture/
empty.py 0 bytes
witness.py VALUE = 1
Commands
graphify extract ./fixture --out ./out --code-only
Expected result
empty.py contains no code, so it should produce no code node. A file with 0 lines cannot carry a source_location.
Actual result
wrote graph.json: 2 nodes, 0 edges, 2 communities
Nodes emitted:
id=empty file_type=code _origin=ast source_file=empty.py source_location=L1
id=witness file_type=code _origin=ast source_file=witness.py source_location=L1
witness.py has 1 line, so L1 is correct there. Only the zero-byte file produces the impossible anchor.
Why L1 is invalid for a 0-byte file
source_location is a provenance anchor: it must designate a line that actually exists in the target file. For a 0-byte file:
- the file has 0 lines;
L1designates a non-existent line;- no line range is valid, so no anchor can be emitted at all.
Any provenance validator that compares source_location against the real file length will reject this. The node is therefore unusable for provenance purposes regardless of how the validator is configured.
Impact
Affects any project containing zero-byte Python files — in practice, any Python package, since __init__.py files are frequently empty. Because the anchor is provably unsatisfiable, such nodes block strict provenance validation of the whole graph.
Suggested fixes
Any one of these would resolve it:
- do not emit a node for a 0-byte file;
- emit the node without
source_location; - emit the node as
file_type=fileinstead ofcode.
Environment
graphify 0.9.72 / 0.9.74
Python 3.13
Windows
- Ngôn ngữ chính
- Python
- Star
- 124k
- Fork
- 11.9k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Graphify-Labs/graphify
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Graphify-Labs/graphify#4860 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Cache the claude backend system prompt via Anthropic prompt cachingCó thể đã có người làm @Jvxoq đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Graphify-Labs/graphify#4835 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
extract --out <dir>: semantic cache never saved, docs missing from manifest (relative source_file resolved against --out)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Graphify-Labs/graphify#4831 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 75/100
Graphify-Labs/graphify#4829 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hooks: last-resort `python3` probe launches the Microsoft Store redirector on Windows (visible console flash, exit 9009)Có thể đã có người làm @Deepjyoti-Sarmah đã nhận 10 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Graphify-Labs/graphify#4563 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Graphify-Labs/graphify
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Validate finite output clamping limits in StepPredictor.prepare_clamping_params to prevent silent NaN/Inf propagationCó thể đã có người làm @muskan-creates352 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
mllam/neural-lam#848 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
infra
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
fab-geocommuns/RNB-coeur#1166 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepspeedai/DeepSpeed#8951 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws/context-ontology-accelerator#343 ·
Maintainer thường phản hồi trong vòng 1 ngày