merge_out_of_scope_commands scanned the new index for entries whose
non-empty path was missing from path_to_id, and its path lookup fell back
to that scan. Every producer of such an entry registers it: the two
serialization arms that skip registration are the ones that write an empty
path deliberately, keeping a slot so ids stay dense, and the loop's own
guard excluded exactly those. The two predicates cannot drift because
interning the empty string yields the empty handle the guard tests for --
which is now stated beside is_empty and pinned, since the guards rest on it
permanently while the comment that mentioned it goes with the map.
The map is not merely unexercised in practice but dominated in principle.
It can only matter on a run where a lookup consults path_to_id for an
unregistered non-empty path, and on exactly those runs deleting it is
better: resolve_file takes its miss branch instead, mints a second entry
for that path copying the old entry's type, and prior_paths has refused a
record naming one path twice since #382 -- usually through its per-list
repeats scan rather than the cross-class overlaps one, because the mint
copies the type of the entry it duplicates. So the deletion never reduces
detection and strictly increases it: what the fallback absorbed in silence
now reaches a reader.
The qualification worth stating: that loudness arrives one build late, and
as a record reported unreadable rather than as the producer that forgot to
register. It is a better failure than none, not a diagnosis.
Measured rather than argued: the function runs 234 times across the test
suite, walking 3126 file entries, and the map receives an entry zero times.
It is entered on every build that has a prior record -- the condition is
`if (old_index)`, with no scope test -- so despite its name it is not
scoped-build-only machinery, and the incremental scenarios exercise it far
more broadly than the issue's suggested net implies.
Closes #391
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Xkm9ce9gsgq41k4k6pvc3
merge_out_of_scope_commands scanned the new index for entries whose
non-empty path was missing from path_to_id, and its path lookup fell back
to that scan. Every producer of such an entry registers it: the two
serialization arms that skip registration are the ones that write an empty
path deliberately, keeping a slot so ids stay dense, and the loop's own
guard excluded exactly those. The two predicates cannot drift because
interning the empty string yields the empty handle the guard tests for --
which is now stated beside is_empty and pinned, since the guards rest on it
permanently while the comment that mentioned it goes with the map.
The map is not merely unexercised in practice but dominated in principle.
It can only matter on a run where a lookup consults path_to_id for an
unregistered non-empty path, and on exactly those runs deleting it is
better: resolve_file takes its miss branch instead, mints a second entry
for that path copying the old entry's type, and prior_paths has refused a
record naming one path twice since #382 -- usually through its per-list
repeats scan rather than the cross-class overlaps one, because the mint
copies the type of the entry it duplicates. So the deletion never reduces
detection and strictly increases it: what the fallback absorbed in silence
now reaches a reader.
The qualification worth stating: that loudness arrives one build late, and
as a record reported unreadable rather than as the producer that forgot to
register. It is a better failure than none, not a diagnosis.
Measured rather than argued: the function runs 234 times across the test
suite, walking 3126 file entries, and the map receives an entry zero times.
It is entered on every build that has a prior record -- the condition is
if (old_index), with no scope test -- so despite its name it is notscoped-build-only machinery, and the incremental scenarios exercise it far
more broadly than the issue's suggested net implies.
The pin is discharged by proof by drift: deleting
intern()'s empty-stringspecial case makes it fail. The pair review found no blockers.
Closes #391