Timeline/XAML: cross-directory definition lookup needs loader search-path proof; filename identity shipped #229

Closed
opened 2026-09-08 15:59:18 +02:00 by buildagent · 3 comments
Member

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,603 SearchDefinitionID occurrences 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:

"paired_file"    => "{c}.dir = {r}.dir AND {c}.pair_key = {r}.pair_key"
"same_directory" => "{c}.dir = {r}.dir"

same_file is narrower still. All three carry dir = dir, and the comment at :302 already says the consequence: "stem match across directories is same_directory plus a coincidence." Their edge is Views/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_SCOPES has no member for that.

2. The source ref lives in someone else's file. bridge.rs:30-34 — source_language is 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 only de.h-dv.xaml could ever declare this bridge, whatever another package's manifest says.

3. de.h-dv.xaml cannot be a destination anyway. It declares resolver = ["bridge_source"] and not bridge_destination, and index.rs:7933 enforces the destination grant as condition 3 on the candidate. So even the genuinely paired_file mirror edge (.shd → its sibling SearchDefs/<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_incoterm inside lg_incoterm.lgd. That string appears nowhere in that file. Their reader computes DefinitionId = Path.GetFileNameWithoutExtension(targetFile) before a byte is read; no element contributes to it. Same for .dataset, where dsFibuErrorLog is 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 optional TAG_FILE_SYMBOL the guest may emit and the HOST validates against the real basename.

The second keeps the host owning the string, the way REL_QUALIFIERS already 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:

THE NAME MUST BE THE BYTES IT POINTS AT. Refs are checkable this way and symbols are not: a ref's span is always the name node's own, while a symbol's decl covers the whole declaration and its name may be normalised (an impl Foo<T> symbol is named Foo).

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_wide or by_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 = dir is 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 why same_directory was 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

  • A package can emit a symbol named from its own file, and the host — not the guest — decides that name. A guest asserting a name the host did not derive must be refused.
  • A fixture where the identity string is absent from the file's bytes, which is the whole case. A fixture whose stem happens to appear in the content proves nothing.
  • The byte-equality rule for REFS is untouched; mutate it and the existing span/name tests must still go RED.
  • If by_stem is 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.rs and record.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."

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,603 `SearchDefinitionID` occurrences 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`: ``` "paired_file" => "{c}.dir = {r}.dir AND {c}.pair_key = {r}.pair_key" "same_directory" => "{c}.dir = {r}.dir" ``` `same_file` is narrower still. All three carry `dir = dir`, and the comment at `:302` already says the consequence: *"stem match across directories is `same_directory` plus a coincidence."* Their edge is `Views/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_SCOPES` has no member for that. **2. The source ref lives in someone else's file.** `bridge.rs:30-34` — `source_language` is 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 only `de.h-dv.xaml` could ever declare this bridge, whatever another package's manifest says. **3. `de.h-dv.xaml` cannot be a destination anyway.** It declares `resolver = ["bridge_source"]` and not `bridge_destination`, and `index.rs:7933` enforces the destination grant as condition 3 on the candidate. So even the genuinely `paired_file` mirror edge (`.shd` → its sibling `SearchDefs/<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_incoterm` inside `lg_incoterm.lgd`. **That string appears nowhere in that file.** Their reader computes `DefinitionId = Path.GetFileNameWithoutExtension(targetFile)` before a byte is read; no element contributes to it. Same for `.dataset`, where `dsFibuErrorLog` is 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 optional `TAG_FILE_SYMBOL` the guest may emit and the HOST validates against the real basename. The second keeps the host owning the string, the way `REL_QUALIFIERS` already 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: > THE NAME MUST BE THE BYTES IT POINTS AT. Refs are checkable this way and symbols are not: a ref's span is always the name node's own, while a symbol's `decl` covers the whole declaration and its name may be normalised (an `impl Foo<T>` symbol is named `Foo`). 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_wide` or `by_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 = dir` is 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 why `same_directory` was 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 * A package can emit a symbol named from its own file, and the host — not the guest — decides that name. A guest asserting a name the host did not derive must be refused. * A fixture where the identity string is **absent from the file's bytes**, which is the whole case. A fixture whose stem happens to appear in the content proves nothing. * The byte-equality rule for REFS is untouched; mutate it and the existing span/name tests must still go RED. * If `by_stem` is 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.rs` and `record.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."*
Author
Member

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.

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 <id> 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.
Author
Member

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.

Timeline [0.1.2 is published](https://git.h-dv.de/h-dv/code-index/releases/tag/pkg%2Fde.h-dv.timeline%2Fv0.1.2). The [official package workflow](https://git.h-dv.de/h-dv/code-index/actions/runs/2347) 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.
buildagent changed title from A whole class of formats is outside the model: identity-from-filename plus search-path resolution has no expressible edge to Timeline/XAML: cross-directory definition lookup needs loader search-path proof; filename identity shipped 2026-11-08 13:54:46 +01:00
Author
Member

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.

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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#229
No description provided.