Skip to content

feat(embedded): EmbeddedOptions has no scriptsDir, so require()/lookup are refused in admin-created imposters (rift#1617) - #348

Merged
EtaCassiopeia merged 1 commit into
masterfrom
feat/rift-343-embedded-scripts-dir
Oct 27, 2026
Merged

EtaCassiopeia merged 1 commit into
masterfrom
feat/rift-343-embedded-scripts-dir

Conversation

@EtaCassiopeia

Copy link
Copy Markdown
Collaborator

rift 0.24.0's rift_serve_admin takes scriptsDir. An imposter posted through the embedded admin plane reads lookup CSVs, require() modules and file: scripts only under it, and without it such a lookup is refused (rift#1611, rift#1617). The embedded transport routes replaceAll through that plane, so on the pinned engine an embedded replaceAll carrying a lookup couldn't work at all.

Change

  • EmbeddedOptions.scriptsDir(Path) (new), sent as scriptsDir in the serve payload. Like the other serve options, it's refused with EngineUnavailable unless the engine advertises scriptsDir in serveOptions (rift ≥ 0.24.0).
  • It does not start the admin plane eagerly. The engine builds each admin request's access from the root when the request arrives, so it doesn't matter when the plane is served. Host-call imposters (create, addStub, applyConfig) stay unconfined (trusted_cwd). The reviewer confirmed both against the v0.24.0 engine source.
  • Docs: README (with the spawn twin, SpawnOptions.scriptsDir from chore(deps): bump rift engine to 0.24.0 and write behaviors the way it admits them #346), docs/design/sdk-api.md, Javadoc.

Tests

  • ServeOptionsScriptsDirTest (+6): the payload key, absent when unset, refusal naming the setter on a 0.23 build-info, acceptance on 0.24, no eager start, null refused.
  • LaunchOptionsIT (+3, real engine), all through replaceAll:
    • a relative CSV path under scriptsDir serves the row;
    • with no scriptsDir the lookup is refused with no --scripts-dir is configured;
    • a CSV outside the root is refused with outside --scripts-dir.

Verification (local, JDK 21, rift 0.24.0)

Full RIFT_IT=1 verify across the reactor (spawn lane, rift-java-embedded-jdk21 with the 0.24.0 dylib, conformance with the 0.24.0 corpus): all modules green.

Downstream: rift-scala's facade needs FacadeCoverage entries for EmbeddedOptions.scriptsDir and SpawnOptions.scriptsDir at its next rift-java bump.

Closes #343

🤖 Generated with Claude Code

… confines to it

rift 0.24.0's rift_serve_admin takes scriptsDir, and an imposter posted
through that plane reads lookup CSVs, require() modules and file: scripts
only under it; without it such a lookup is refused (rift#1611, rift#1617).
The embedded transport routes replaceAll through the plane, so an embedded
replaceAll carrying a lookup could not work at all on the pinned engine.

EmbeddedOptions.scriptsDir(Path) sends it, refused like the other serve
options unless the engine advertises it. It does not start the plane early:
the engine reads the root per admin request, and host-call imposters
(create, addStub) stay unconfined.

Closes #343
@EtaCassiopeia
EtaCassiopeia merged commit 9fbaae7 into master Oct 27, 2026
18 checks passed
@EtaCassiopeia
EtaCassiopeia deleted the feat/rift-343-embedded-scripts-dir branch October 27, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(embedded): EmbeddedOptions has no scriptsDir, so require()/lookup are refused in admin-created imposters (rift#1617)

1 participant