Repository navigation
feat(core): add shared source-tree views and dependency tracking - #775
Draft
frederikgeth wants to merge 1 commit into
Draft
frederikgeth wants to merge 1 commit into
frederikgeth wants to merge 1 commit into
Conversation
Contributor
Conversion MatrixEach cell writes the source as the target and reads it back. The symbol is the worst finding. ⚪ exact 🟢 lossless 🔵 restated: only values the target requires were synthesized 🟡 approximate: values changed to fit 🟠 dropped: source data has no target field 🔴 failed: error, invariant, or baseline change Transmission: into a case format
Transmission: into an exchange format
Transmission: into a dataset directory
Distribution: into a distribution format
Full warning details: download |
This branch has not been deployed
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.
What and why
Part of #774 — P1.
Several case entry points can reuse topology and data without rebuilding the supplied file inventory or sharing parser state. This adds
SourceTreeandSourceTreeLimitsinpowerio-core, re-exported by the facade. Each selection exposes a directory or a primary file relative to a selected root, sharing immutable bytes while rebasing names, source IDs, and reference directories.Explicit limits bound exposed file count, combined byte length, and path depth; they do not read environment variables.
Source::dependencies()reports successful nonprimary reads in deterministic order. Source clones share observations, while independent selections do not. Listing or replaying retained companions and failed reads do not add dependencies. Retained companions remain available for byte-exact replay.Tests cover shared byte identity, root confinement, foreign-referrer rejection, exact limit boundaries, independent observations, two OpenDSS masters parsed in either order, legacy-parser value/diagnostic parity, source replay, and an isolated PyPSA directory view.
Decisions for the maintainer
None outstanding beyond review of the additive P1 API. The implementation keeps the existing 64-segment resolver bound, case-sensitive paths, and explicit view limits. A view retains its shared tree owner; its smaller exposure limit does not imply that the rest of the shared allocation is released.
Not in this pull request
ZIP decoding, case discovery, document-role grouping, collection manifests, CLI/browser selection, and binding entry points remain follow-ups in #774. This changes no electrical interpretation, C ABI, or PowerIO IR layout.
Files outside the main change
powerio-core/src/lib.rsandpowerio/src/lib.rs: public re-exports.CHANGELOG.md: the additive source API under Unreleased.powerio/tests/source_tree_views.rs: facade-level parsing and exact-replay regressions alongside the core source tests.No dependency, workflow, generated header, schema snapshot, or conversion baseline changes.
Fixtures
No new fixture files. Test inputs are small synthetic byte/string literals.
Checks
Commands used
CARGO_TARGET_DIR=/private/tmp/powerio-source-tree-target.Passed:
cargo fmt --all --checkandgit diff --check.cargo test: 3,413 passed across the default workspace and doctests.cargo test -p powerio-capi: 54 passed, one existing ignored test.cargo test -p powerio-core: rerun after review, including the new integration tests and rustdoc example.cargo test -p powerio --test source_tree_views --test memory_tree --no-default-features.cargo clippy -p powerio-core --all-targets -- -D warnings.cargo clippy -p powerio --lib --test source_tree_views --no-default-features -- -D warnings.cargo check -p powerio --no-default-features --target wasm32-unknown-unknown.RUSTDOCFLAGS="-D warnings" cargo doc -p powerio-core -p powerio --no-deps --all-features.Existing Clippy failures
bash scripts/ci-clippy.shwas rerun with rustc 1.96.0 / Clippy 0.1.96. The workspace target fails on existingclippy::float_cmpassertions:Both files are byte-identical to upstream main at
8335e3b, verified by comparing their Git blob IDs. Neither file nor the lint policy is changed here.Because the full script stops after its first failed target, the remaining configurations were also run individually:
The PR remains draft while the full Clippy gate is red; it is not asking for review yet. No unrelated baseline fixes are bundled into P1.
Not run:
scripts/ci-mirror.shand mdBook/SemVer checks. The local mdBook and cargo-semver-checks executables are unavailable, and the full Clippy gate has the failures documented above. Cross-platform, MSRV, Julia, fuzz, and independent format-oracle jobs are left to CI; this PR adds source acquisition APIs without changing electrical parser semantics.