test(env-options,marshal): per-compartment options are scoped#3299
Open
kriskowal wants to merge 2 commits into
Open
test(env-options,marshal): per-compartment options are scoped#3299kriskowal wants to merge 2 commits into
kriskowal wants to merge 2 commits into
Conversation
Adds a test that loads `@endo/env-options` into a sub-compartment via `@endo/compartment-mapper`'s `importLocation`, with the sub-compartment's own `process.env` plumbed in through per-compartment `globals.process.env`. The captor inside the sub-compartment reads the sub-compartment's env, not the parent's. Exercises the `ENDO_RANK_STRINGS` switch: string ranking inside the sub-compartment follows the per-compartment setting (`unicode-code-point-order`) while the parent retains the default (`utf16-code-unit-order`), and sibling sub-compartments observe their own envs independently. Closes #2879
|
Open
6 tasks
kriskowal
pushed a commit
to kriskowal/garden
that referenced
this pull request
Jun 7, 2026
…oses #2879; Claude trailers stripped)
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.
Closes: #2879
Description
Adds a test confirming that
@endo/env-optionsreadsglobalThis.process.envfrom the compartment it runs in, so settings likeENDO_RANK_STRINGSare scoped per compartment rather than leaking from the parent.The test loads
@endo/env-optionsinto a sub-compartment via@endo/compartment-mapper'simportLocation, with the sub-compartment's ownprocess.envsupplied through per-compartmentglobals.process.env. It then checks that string ranking inside the sub-compartment follows that compartment'sENDO_RANK_STRINGSsetting (unicode-code-point-order) while the parent retains the default (utf16-code-unit-order), and that two sibling sub-compartments observe their own envs independently.Security Considerations
No new authorities. The change is test-only; it documents and pins existing per-compartment isolation of env-options rather than altering any boundary.
Scaling Considerations
None. The added test runs at the same cost as the package's existing tests.
Documentation Considerations
None. The behavior under test (env-options reading the running compartment's
process.env) is already the intended contract.Testing Considerations
This PR is itself the test. It exercises the captor through
@endo/compartment-mapperthe way a real downstream consumer would, rather than constructing aModuleSourceby hand.Compatibility Considerations
None. No usage patterns change.
Upgrade Considerations
None.