Timeline/XAML: cross-directory definition lookup needs loader search-path proof; filename identity shipped #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?
Audit on v0.41.45 (2026-11-08): filename-derived identity and definition-local field ownership already shipped in Timeline 0.1.2 and were tested against published packages. Do not schedule those as new features or add another ABI for them. The remaining feature is the cross-directory lookup relation. It needs the framework loader's actual search roots, ordering, case and override rules; no project-wide same-name fallback is justified. The original report below is historical and its filename-input/identity premise has been superseded.
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."Partial implementation is committed locally as
fe55f2c6, not merged/released yet. Timeline 0.1.2 now uses the existing host-owned TAG_SYMBOL_BASENAME (minimum fact minor 2) for all four definition formats. No new ABI was necessary. Names are derived from the actual routed filename, including dotted stems; stale XML values are not used. The root is an impl container, excluded from ordinary field/type pools.The signed-package regression covers names absent from content, all four extensions, unknown roots, same-name display-field decoys, file rename/move and database reopen. All five declared package conformance fixtures now run in the Timeline lane; source reproducibility, artifact records and strict Clippy pass. The public CLI/MCP proof also passes on an actual published 0.1.1 → signed candidate upgrade, snapshot/daemon queries, live rename and restart.
That regression additionally reproduced an existing cross-definition phantom: exported fields in one .lgd could satisfy an unrelated missing column in another. The candidate makes tables/fields/arguments definition-local and requests only same_file_candidate; its own existing-column references still bind and the unrelated one stays unresolved.
The search-path relation remains unimplemented, so this issue remains open. I need the actual loader source / exact four search roots and precedence (including duplicate stems, case handling and per-project overrides) before binding cross-directory GridDef/SearchDefinitionID literals. The workspace currently exposes only code-index, and these runtime lookup rules are not in this repository. A project-wide filename match is not a substitute for that proof.
Timeline 0.1.2 is published. The official package workflow passed its grading, signing, publication and signed-channel download checks.
A separate public CLI/MCP test installed the actual published 0.1.1 package, reproduced its cross-definition column binding, then upgraded to the actual signed 0.1.2 package on published core 0.41.41. It verified host-owned filename identities absent from the XML bytes, removal of the foreign column binding, snapshot and daemon answers, live filename rename and restart. All passed. Local receipt:
/tmp/cosi-229-published-012-on-04141/verification.json.This delivers filename identity and definition-local symbol ownership without changing the fact ABI. The issue remains open: the cross-directory four-root lookup relation is not implemented. The actual framework loader's roots, ordering, case and override rules are still needed to define that relation safely; the related MCP dataset catalog is not evidence of those framework rules.
A whole class of formats is outside the model: identity-from-filename plus search-path resolution has no expressible edgeto Timeline/XAML: cross-directory definition lookup needs loader search-path proof; filename identity shippedbuildagent referenced this issue2026-11-09 09:21:02 +01:00
Consolidated into #548 during the 2026-11-09 triage. The remaining scope of this issue is tracked there as a checklist item; this report stays as the detailed evidence.