fix(stella-cli): resolve the current self-driving root through stella-home too - #1877
Merged
Conversation
…-home too #1810 factored the LEGACY roots into `stella-home` so the writer and the read-only reader could not drift, and moved `stella-observatory` onto `stella_home::self_driving_root` for the current one — but left `LoopState::open` building `home.join("self-driving")` itself. Half the job: the current root, the one every live loop actually uses, was still two literals in two crates. That is the exact shape #1755 was filed for. Renaming the directory in one of them would point the dashboard at nothing, and the failure is silent — an empty Self-Driving tab reads as "no runs", never as "the reader is looking in the wrong place". Witness: `the_current_root_comes_from_the_shared_resolver` pins that the shared resolver still yields the directory this crate writes and the observatory reads. The test helper keeps its own literal deliberately — a test that re-derives the expected path from the code under test cannot catch a change to it. Refs #1755
Contributor
There was a problem hiding this comment.
Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Reviewer's GuideRoutes stella-cli’s self-driving state root resolution through the shared stella-home resolver instead of a hard-coded path, and adds a test to pin that the current root still matches the literal used in migration tests and stella-observatory. Sequence diagram for shared self-driving root resolution in LoopState::opensequenceDiagram
participant LoopState
participant stella_home
participant Filesystem
LoopState->>stella_home: stella_home::stella_home()
stella_home-->>LoopState: Option<PathBuf> home
LoopState->>LoopState: repo_slug(repo_root) -> slug
LoopState->>stella_home: resolve_self_driving_root(Some(home.clone()))
stella_home-->>LoopState: Option<PathBuf> self_driving_root
LoopState->>LoopState: self_driving_root.join(slug) -> dir
LoopState->>Filesystem: migrate_legacy_state(dir, slug, home)
LoopState-->>LoopState: use dir as self-driving state root
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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 & why
Refs #1755
#1810 factored the legacy self-driving roots into
stella-homeso the writer and the read-only reader could not drift, and movedstella-observatoryontostella_home::self_driving_rootfor the current one — but leftLoopState::openbuilding its own:Half the job. The current root — the one every live loop actually uses — was still two literals in two crates:
That is the exact shape #1755 was filed for. Renaming the directory in one of them would point the dashboard at nothing, and the failure is silent — an empty Self-Driving tab reads as "no runs on this machine", never as "the reader is looking in the wrong place". I introduced this in #1810, so it is mine to close.
The witness
the_current_root_comes_from_the_shared_resolverpins that the shared resolver still yields the directory this crate writes and the observatory reads — the twin of the existingthe_writer_and_the_reader_agree_on_the_legacy_roots.The migration test helper keeps its own hard-coded literal deliberately: a test that re-derives the expected path from the code under test cannot catch a change to it. The tests state the path; the code resolves it.
The gate
cargo test -p stella-cli --bin stella self_driving_cmd::state— 7 / 7cargo fmt --check— cleancargo clippy -p stella-cli --all-targets -- -D warnings— clean for this crateNothing left behind
Nothing new.
mainis currently red on three fronts, all with fixes in flight: the clippy error above (#1873/#1859), thefile-sizebaseline skew and the stale gate-parity count (both in #1845; #1863 carries the same count fix).Summary by Sourcery
Unify resolution of the current self-driving state root in stella-cli with the shared stella-home resolver to prevent drift between writer and reader paths.
Bug Fixes:
Tests: