host: tighten venue-registry install seam and mutex discipline - #534
Merged
Conversation
mfw78
force-pushed
the
docs/507-venue-registry-install-discipline
branch
from
July 23, 2026 14:15
6827750 to
5eea4b9
Compare
Install is boot-time only; drop it off the shared public handle so a post-boot clone cannot register with no compiler signal. Out-of-crate tests reach a mock adapter through the test-utils install_for_test seam.
mfw78
force-pushed
the
docs/507-venue-registry-install-discipline
branch
from
July 23, 2026 14:52
5eea4b9 to
dd71a37
Compare
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
Tighten the
VenueRegistry::installseam incrates/videre-host/src/registry.rson two fronts.Document the mutex discipline:
installtakes the adapter-map mutex only for the synchronous insert and never holds it across an await.Narrow visibility from
pubtopub(crate), recording the boot-only invariant that adapters install at provider boot and never post-boot through a shared handle clone.Add a
#[cfg(feature = "test-utils")] pub fn install_for_testshim that forwards toinstall, so out-of-crate tests install a mock adapter without the provider boot path.A new
test-utilsfeature gates the shim, and a self dev-dependency onvidere-hostwith that feature turns it on for this crate's own test targets socargo test -p videre-hostseesinstall_for_testwithout every invocation passing--features test-utils.The lone out-of-crate caller,
scripted_registryintests/platform.rs, now installs viainstall_for_test.Why
installwas public but only ever legitimately called at provider boot, so an external caller could install an adapter post-boot through a cloned handle and silently break the boot-only invariant.Making it
pub(crate)closes that seam while the feature-gatedinstall_for_testkeeps the direct install available to tests, and the mutex-discipline note documents the no-await-under-lock contract for future editors.Testing
All commands run from the worktree root inside
nix develop --command, against the shared warm target dir, scoped to the touched cratevidere-host.cargo fmt --all -- --checkclean, no diff.cargo clean -p videre-hostthencargo clippy -p videre-host --all-targets --all-features -- -D warningsclean rebuild with zero warnings across lib, tests and examples.cargo test -p videre-host --all-featurespassed: 47 unit, 14 platform.rs, 2 zero_leak, 0 failed. This covers the reworked seam, withscripted_registryinstalling via the feature-gatedinstall_for_testand the boot-pathpub(crate) installstill exercised by the e2e tests.AI Assistance
Implemented, reviewed and verified with Claude Code (Opus).
Closes #507