A whole class of formats is outside the model: identity-from-filename plus search-path resolution has no expressible edge #229
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#229
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reported by an external package author who went and read the SQL rather than filing a wish. They answered their own question in the process and the answer is worth more than the question was: the edge they wanted is structurally inexpressible for four independent reasons, and only the last one is really about bridges.
Measured on their corpus: 2,539
GridDef+ 1,603SearchDefinitionIDoccurrences across 3,942 tracked XAML files; all 389 distinct literals resolve to a tracked stem. It is the single highest-value cross-file relation in that format family, and none of it is reachable today.The four reasons, in ascending order of how fundamental they are
1. Every bridge scope is directory-local.
crates/indexer/src/bridges.rs:304-307:same_fileis narrower still. All three carrydir = dir, and the comment at:302already says the consequence: "stem match across directories issame_directoryplus a coincidence." Their edge isViews/Foo.xaml→LookupGrids/lg_incoterm.lgd— different directory, different stem, resolved at runtime by a four-root search path keyed on the stem alone.BRIDGE_SCOPEShas no member for that.2. The source ref lives in someone else's file.
bridge.rs:30-34—source_languageis always<this package>/<local>, "not because a check refuses it, but because there is no way to build the value." The ref is in the.xaml, so onlyde.h-dv.xamlcould ever declare this bridge, whatever another package's manifest says.3.
de.h-dv.xamlcannot be a destination anyway. It declaresresolver = ["bridge_source"]and notbridge_destination, andindex.rs:7933enforces the destination grant as condition 3 on the candidate. So even the genuinelypaired_filemirror edge (.shd→ its siblingSearchDefs/<stem>.xaml, same directory, same stem) is blocked — on the XAML package's side, not the reporter's.4. AND THERE IS NOTHING TO BIND TO. This is the one that makes the first three academic.
A bridge matches a source ref NAME to a destination symbol NAME. The destination symbol would have to be named
lg_incoterminsidelg_incoterm.lgd. That string appears nowhere in that file. Their reader computesDefinitionId = Path.GetFileNameWithoutExtension(targetFile)before a byte is read; no element contributes to it. Same for.dataset, wheredsFibuErrorLogis the identity and is not in the bytes.So even granting 1, 2 and 3, the bridge would have no candidate.
Why this reframes the missing-path gap
extract(src_ptr, src_len, tree_ptr, tree_len)gives the guest no path. That has been treated — including by me, one message earlier in the same conversation — as a limitation on symbol coverage: a package cannot emit a nice-to-have module symbol named after its file.It is not that. It is what makes the highest-value cross-file relation in 1,323 files unresolvable in principle. An entire class of formats works this way: identity from the filename, resolution by search path rather than by relative import. Definition files, resource dictionaries, config sets, typed-dataset descriptors. None of them can currently be linked to anything.
The cheap fix, and why it does not disturb the fact protocol
The reporter's proposal, and it is better than the obvious one. Not the full path — either the file STEM as a fourth input to
extract, or an optionalTAG_FILE_SYMBOLthe guest may emit and the HOST validates against the real basename.The second keeps the host owning the string, the way
REL_QUALIFIERSalready works. And critically, it does not touch the byte-equality rule, because symbols are already exempt from it.crates/abi/src/record.rs:920-927, verbatim:So nothing in the fact protocol has to move. The missing thing is an INPUT, not an output. That is what makes this cheap enough to be worth doing.
The second ask, recorded with its own counter-argument
A non-proximity bridge scope —
project_wideorby_stem— matching a destination anywhere in the project rather than in the same directory.The reporter raised it and argued against it in the same breath, which is why it is worth recording rather than dismissing:
dir = diris what keeps the join bounded, and an unscoped name match across a 10k-file repository is a cross-product with obvious phantom risk — almost certainly whysame_directorywas chosen. Their position: "if the answer is 'no, and here is the cardinality that says why', that is a good answer I would record rather than re-litigate."That is the right way to close it if it closes. But it should close with a measured cardinality, not with silence, because the class of formats it excludes is real and now has a number attached: four extensions, 1,323 files, in one repository.
What a fix must prove
by_stemis implemented rather than declined: the cardinality of the join measured on a 10k-file repository, and a phantom count, before it is enabled by default.Provenance
Filed from an external package author's analysis of
bridges.rs,bridge.rs,index.rsandrecord.rs. I verified reason 4's load-bearing claim (record.rs:920-927) directly; the other three cite lines whose content matches. Their own package ships with no bridges and is unaffected either way — as they put it, "I would rather you heard this from a package author who went and read the SQL than from a bug report six months from now."