Repository navigation
Conversation
Fixes the two blindspots that made the ZORRA-1 ledger noise:
1) `pub use` items are materialized:
- named item re-exports -> one alias at parent::name
- module aliases expand public contents; duplicate-segment collapse maps
`pub use zorro_io as io` to `zorro::io::X` (not `::io::io::X`)
- globs expand into the parent, including globs of private local modules
(walked through the index tree, which `paths` cannot express)
- local use chains resolved; aliases carry snapshot::RE_EXPORT_ATTR
2) Signatures are id-stable:
- resolved_path drops ids and prefers the canonical defining path
- impls/implementations/items/fields/variants/links id lists become sorted
stable labels; generic params become local:<name>
- after alias discovery, signature type paths prefer the shortest local
re-export spelling (zorro_nn::backend::ComputeBackend ->
zorro::backend::ComputeBackend)
classify: signature changes on re-export-backed items are Warning (the
defining crate owns the shape).
ledger: API_DRIFT_UPDATE=1 now rewrites an existing snapshot (was first-record
only). Demo ledger regenerated (one resolved_path.id removal).
Limits documented in the ticket: rustdoc's `paths` table is a reference table,
so a dependency's flattened re-exports are only materialized where referenced;
cross-crate type moves still read as genuine signature drift.
Tests: workspace all-features green; clippy clean; new synthetic coverage for
alias/glob/private-module/chain/id-churn; validated on zorro (surface 61->202).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two producer blindspots made the ledger unusable beyond the "does the consumer compile" fallback (found while gating zorro's 13-crate decomposition, ZORRA-1 step 4):
pub usechains vanished — every shimmed path (zorro::io,zorro::kv_cache,zorro::pipeline::sampling, …) was reported asRemovedeven though it existed.SignatureChanged(“id-noise”).What
Re-export materialization (
producer.rs):<parent>::<name>;pub use zorro_io as iomaps tozorro::io::X, notzorro::io::io::X;pathscannot express);usechains resolve to the ultimate target;snapshot::RE_EXPORT_ATTRand a stable signature (target payload for in-crate targets,re-export of <path>for external ones).Signature normalization:
resolved_pathdrops ids and uses the canonical defining path;impls/implementations/items/fields/variants/linksid lists become sorted stable labels (paths, local names, impl descriptors);local:<name>;zorro_nn::backend::ComputeBackend→zorro::backend::ComputeBackend).Classification / ledger:
Warning(the defining crate owns the shape), notBreaking;API_DRIFT_UPDATE=1now rewrites an existing snapshot (it previously only handled the first record, so the documented recording command silently did nothing after init). Demo ledger regenerated.Validation
cargo test --workspace --all-featuresgreen; new synthetic tests for named/module/glob/private-module/chain materialization and id churn (same shape + different ids → no diff).cargo clippy --workspace --all-features --all-targetsclean.TensorIndexetc.), not ids.Known limits (documented in the ticket)
rustdoc JSON's
pathsis a reference table, not a dependency index, so a dependency's flattened re-exports (zorro_io'spub use io::*) are only materialized where referenced. Full reconstruction needs ingesting dependency rustdoc JSON (filed as a follow-on).Compatibility note
diff::Changedgainsold_attrs/new_attrs(struct literal construction is affected; only internal call sites in this repo). New public items:snapshot::RE_EXPORT_ATTR,producerbehavior. No crate version bump yet — this is for the next release.Ticket:
.jagent/planning/tickets/APIDRIFT-21-reexport-materialization.md.