You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes#902 by validating process.cwd against the selected backend and lifecycle surface instead of allowing an explicit value to be silently discarded or resolved against ambient host state.
Compatibility
Surface
Working-directory behavior
Ordinary v0.6-v0.8 JSON requests
Existing relative-path compatibility is preserved.
Ordinary v0.9/v0.10 JSON and typed SDK requests
Windows targets require a rooted Windows path; POSIX targets require an absolute POSIX path.
WSLc one-shot
Requires a rooted local Windows drive path and maps it under /mnt/<drive> in every contract version. Unmappable explicit values fail loudly.
WSLc state-aware exec
Requires an absolute in-container POSIX path.
Details
Carry working-directory compatibility from each exact contract adapter into the normalized execution request.
Validate one-shot, streaming, dry-run, typed SDK, and state-aware exec paths before execution or host policy changes.
Preserve existing omitted-cwd fallback behavior for each backend.
Preserve malformed sandbox-ID precedence over state-aware cwd policy errors.
Return actionable, escaped policy-validation diagnostics rather than silently replacing explicit values.
Document backend-specific path forms and omitted-cwd behavior, including Bubblewrap's native launch-directory behavior.
Regenerate the development schema and TypeScript wire documentation.
Limit whitespace fallback documentation to applicable backends
docs/schema.md:298
This compatibility statement is too broad. Bubblewrap and LXC treat only the empty string as omitted (bwrap_command.rs:556-564, lxc_runner.rs:52-60), so a legacy whitespace-only value is passed to --chdir/cd rather than falling back. Limit the documented fallback to the backends that use resolved_working_directory_with (ProcessContainer and Seatbelt).
Qualify target-absolute cwd rule for current-contract behavior
sdk/node/src/types.ts:20
ProcessConfig also represents raw exact-version configs, and v0.6-v0.8 deliberately retain relative cwd acceptance for ordinary backends. The unqualified target-absolute statement conflicts with the compatibility behavior documented in sdk/node/README.md:538-539; qualify it as the current-contract rule.
Closing this PR because the implementation is not converging.
The review exposed two public-contract problems that require design work beyond the scope of this change:
Exact one-shot JSON cwd validation currently occurs during parsing, which prevents it from producing the intended typed policy_validation result.
The shared one-shot envelope mapping changes error codes for every backend, rather than only classifying cwd validation failures.
Issue #902 remains open. The next attempt should split the work into smaller changes: a minimal WSLc one-shot fail-loud fix that preserves its existing path contract, and a separately designed relative-cwd contract change with an explicit parsing and public-error model.
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
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.
This PR fixes #902 by validating
process.cwdagainst the selected backend and lifecycle surface instead of allowing an explicit value to be silently discarded or resolved against ambient host state.Compatibility
/mnt/<drive>in every contract version. Unmappable explicit values fail loudly.Details
Tests
cargo fmt --all -- --checkcargo check --workspace --all-targets