You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a diff whose sole change is three lines appended at EOF of a large flat
YAML list file, diffctx . --diff HEAD~1 emits a context output that:
Carries zero role: "changed" fragments. Not a single fragment in the
output is labeled as the change — grep -c 'role:' output.yaml → 0. The
"what changed" signal is entirely lost even though the diff is non-empty and
valid.
Does not surface the changed lines at all. The change adds new lines
786–788 (@@ -785,3 +785,6 @@); the highest line range anywhere in the
output is 785-785. The appended lines never appear as their own fragment.
Explodes the whole ~790-line file into ~118 tiny definition fragments
(lines: "4-6", "14-14", "17-17", … "785-785"), i.e. nearly the
entire unchanged file is dumped as context.
Also pulls in 2 unrelated files that the diff never touched.
Total: fragment_count: 120, ~5.9k tokens, for a 3-line append.
Expected
The appended lines (786–788) surfaced as a role: "changed" fragment — the
change must always be represented and labeled.
Context scoped to the changed region + tight related context, not a
whole-file fragmentation of a flat data-list file.
The changed file is muted-tests.yml, a flat top-level YAML list
(- class: … / method: … / issue: … entries) ~790 lines long.
Analysis
Two distinct symptoms, likely two root causes:
(A) Lost change signal — the EOF-append hunk maps to new lines 786–788,
but no rendered fragment is in core_ids, so role: "changed" is never set.
Either the changed-fragment for an at-EOF append in a non-code list file is
never created, or it is dropped/absorbed during selection/merge. This is a correctness bug — worse than over-selection — since the actual answer to
"what changed" is absent. Verified the field is emitted normally on other
repos (e.g. numpy HEAD~1 yields 5 role: "changed" fragments), so this is
a real omission, not a formatting artifact.
Observed
On a diff whose sole change is three lines appended at EOF of a large flat
YAML list file,
diffctx . --diff HEAD~1emits a context output that:role: "changed"fragments. Not a single fragment in theoutput is labeled as the change —
grep -c 'role:' output.yaml→0. The"what changed" signal is entirely lost even though the diff is non-empty and
valid.
786–788 (
@@ -785,3 +785,6 @@); the highest line range anywhere in theoutput is
785-785. The appended lines never appear as their own fragment.definitionfragments(
lines: "4-6","14-14","17-17", …"785-785"), i.e. nearly theentire unchanged file is dumped as context.
Total:
fragment_count: 120, ~5.9k tokens, for a 3-line append.Expected
role: "changed"fragment — thechange must always be represented and labeled.
whole-file fragmentation of a flat data-list file.
Repro
Public repo, deterministic:
The changed file is
muted-tests.yml, a flat top-level YAML list(
- class: … / method: … / issue: …entries) ~790 lines long.Analysis
Two distinct symptoms, likely two root causes:
but no rendered fragment is in
core_ids, sorole: "changed"is never set.Either the changed-fragment for an at-EOF append in a non-code list file is
never created, or it is dropped/absorbed during selection/merge. This is a
correctness bug — worse than over-selection — since the actual answer to
"what changed" is absent. Verified the field is emitted normally on other
repos (e.g. numpy
HEAD~1yields 5role: "changed"fragments), so this isa real omission, not a formatting artifact.
per-entry
definitionfragments and most of the file is selected as context.This over-selection facet overlaps diffctx over-selection: PPR/edge relevance filter pulls in unrelated files (whole-tree over-dump + co-located k8s manifests) #65 (whole-tree over-dump); tracking (A)
here because the missing
role: "changed"is a separate, sharper failure.Env
perl -e 'alarm 200; exec @ARGV' diffctx . --diff HEAD~1(nohang — completed in well under the cap)
Related: #65 (over-selection). This issue is primarily about (A).